From 913420a319a9efad45de8dd4a95e9a5b15c346f8 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 2 May 2022 20:08:27 +0100 Subject: [PATCH] Initial commit --- .github/workflows/ci.yml | 80 +++++++++++++++++++++++ .gitignore | 133 +++++++++++++++++++++++++++++++++++++++ README.md | 7 +++ app/main.py | 8 +++ codecov.yml | 2 + renovate.json | 6 ++ requirements-dev.txt | 4 ++ requirements.txt | 0 tests/test_main.py | 0 9 files changed, 240 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 app/main.py create mode 100644 codecov.yml create mode 100644 renovate.json create mode 100644 requirements-dev.txt create mode 100644 requirements.txt create mode 100644 tests/test_main.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a761564 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: CI +on: + workflow_dispatch: + push: + paths-ignore: + - 'README.md' + - 'LICENSE.md' + - '.gitignore' + pull_request: + +jobs: + skip_duplicate: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v4.0.0 + with: + github_token: ${{ github.token }} + + analyze: + name: Analyze + needs: skip_duplicate + if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: python + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + + lint: + needs: skip_duplicate + if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: pip install -r requirements.txt && pip install -r requirements-dev.txt + - name: Lint + run: pylint --recursive=yes . + + test: + needs: skip_duplicate + if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.10' ] + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: pip install -r requirements.txt && pip install -r requirements-dev.txt + - name: Run test suite + run: coverage run -m py.test -v + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb31eb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,133 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# IDE +.vscode +.idea diff --git a/README.md b/README.md new file mode 100644 index 0000000..86b71e3 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# template + +## Description + +## How to install + +## How to use diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..a6053f8 --- /dev/null +++ b/app/main.py @@ -0,0 +1,8 @@ +#!/usr/local/bin/python3 + +def main(): + # Commands here + + +if __name__ == "__main__": + main() diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..9fa3a4e --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "*/tests/*” \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..8b6dd1e --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "extends": [ + "config:base" + ] + } + \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..fcf0dd6 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +black +coverage +pylint +pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000..e69de29