-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General refactor/restructure of project (#312)
* General refactor/restructure of project * Change example in readme
- Loading branch information
1 parent
96a3c9f
commit 55c352c
Showing
22 changed files
with
405 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,97 +7,170 @@ on: | |
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.9" | ||
|
||
jobs: | ||
precommit: | ||
name: ${{ matrix.name }} | ||
codespell: | ||
name: codespell | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
strategy: | ||
matrix: | ||
include: | ||
- id: bandit | ||
name: Check with bandit | ||
- id: black | ||
name: Check code style | ||
- id: blacken-docs | ||
name: Check code style in documentation | ||
- id: check-ast | ||
name: Check Python AST | ||
- id: check-case-conflict | ||
name: Check for case conflicts | ||
- id: check-docstring-first | ||
name: Check docstring is first | ||
- id: check-executables-have-shebangs | ||
name: Check that executables have shebangs | ||
- id: check-json | ||
name: Check JSON files | ||
- id: check-merge-conflict | ||
name: Check for merge conflicts | ||
- id: check-symlinks | ||
name: Check for broken symlinks | ||
- id: check-toml | ||
name: Check TOML files | ||
- id: check-yaml | ||
name: Check YAML files | ||
- id: codespell | ||
name: Check code for common misspellings | ||
- id: debug-statements | ||
name: Debug Statements and imports (Python) | ||
- id: detect-private-key | ||
name: Detect Private Keys | ||
- id: end-of-file-fixer | ||
name: Check End of Files | ||
- id: fix-byte-order-marker | ||
name: Check UTF-8 byte order marker | ||
- id: flake8 | ||
name: Enforcing style guide with flake8 | ||
- id: isort | ||
name: Check imports are sorted | ||
- id: poetry | ||
name: Check pyproject file | ||
- id: pylint | ||
name: Check with pylint | ||
- id: pyupgrade | ||
name: Check for upgradable syntax | ||
- id: trailing-whitespace | ||
name: Trim Trailing Whitespace | ||
- id: vulture | ||
name: Check for unused Python code | ||
- id: yamllint | ||
name: Check YAML style | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: 🏗 Set up Python 3.9 | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: 🏗 Get pip cache dir | ||
id: pip-cache | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: ⤵️ Restore cached Python PIP packages | ||
uses: actions/cache@v3 | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Check code for common misspellings | ||
run: poetry run pre-commit run codespell --all-files | ||
|
||
ruff: | ||
name: Ruff | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }} | ||
restore-keys: | | ||
pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}- | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
pip install -r .github/workflows/requirements.txt | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: ⤵️ Restore cached Python virtual environment | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Run Ruff | ||
run: poetry run ruff . | ||
|
||
black: | ||
name: black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
path: .venv | ||
key: >- | ||
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | ||
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}- | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Run black on docs | ||
run: poetry run blacken-docs | ||
|
||
pre-commit-hooks: | ||
name: pre-commit-hooks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Check Python AST | ||
run: poetry run pre-commit run check-ast --all-files | ||
- name: 🚀 Check for case conflicts | ||
run: poetry run pre-commit run check-case-conflict --all-files | ||
- name: 🚀 Check docstring is first | ||
run: poetry run pre-commit run check-docstring-first --all-files | ||
- name: 🚀 Check that executables have shebangs | ||
run: poetry run pre-commit run check-executables-have-shebangs --all-files | ||
- name: 🚀 Check JSON files | ||
run: poetry run pre-commit run check-json --all-files | ||
- name: 🚀 Check for merge conflicts | ||
run: poetry run pre-commit run check-merge-conflict --all-files | ||
- name: 🚀 Check for broken symlinks | ||
run: poetry run pre-commit run check-symlinks --all-files | ||
- name: 🚀 Check TOML files | ||
run: poetry run pre-commit run check-toml --all-files | ||
- name: 🚀 Check XML files | ||
run: poetry run pre-commit run check-xml --all-files | ||
- name: 🚀 Check YAML files | ||
run: poetry run pre-commit run check-yaml --all-files | ||
- name: 🚀 Check YAML files | ||
run: poetry run pre-commit run check-yaml --all-files | ||
- name: 🚀 Detect Private Keys | ||
run: poetry run pre-commit run detect-private-key --all-files | ||
- name: 🚀 Check End of Files | ||
run: poetry run pre-commit run end-of-file-fixer --all-files | ||
- name: 🚀 Trim Trailing Whitespace | ||
run: poetry run pre-commit run trailing-whitespace --all-files | ||
|
||
pylint: | ||
name: pylint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Run pylint | ||
run: poetry run pre-commit run pylint --all-files | ||
|
||
yamllint: | ||
name: yamllint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install Python dependencies | ||
run: poetry install --no-interaction | ||
- name: 🚀 Run pre-commit for ${{ matrix.id }} | ||
run: poetry run pre-commit run ${{ matrix.id }} --all-files | ||
- name: 🚀 Run yamllint | ||
run: poetry run yamllint . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,42 +7,28 @@ on: | |
types: | ||
- published | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.9" | ||
|
||
jobs: | ||
release: | ||
name: Releasing to PyPi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⤵️ Check out code from GitHub | ||
uses: actions/[email protected] | ||
- name: 🏗 Set up Python 3.9 | ||
uses: actions/checkout@v3 | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: 🏗 Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
echo "::set-output name=dir::$(pip cache dir)" | ||
- name: ⤵️ Restore cached Python PIP packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pip-cache.outputs.dir }} | ||
key: pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }} | ||
restore-keys: | | ||
pip-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}- | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: 'poetry' | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
pip install -r .github/workflows/requirements.txt | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: ⤵️ Restore cached Python virtual environment | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: >- | ||
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }} | ||
venv-${{ runner.os }}-v3-${{ steps.python.outputs.python-version }}- | ||
- name: 🏗 Install dependencies | ||
run: poetry install --no-interaction | ||
- name: 🏗 Set package version | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.