Skip to content

Commit 8a4ec5f

Browse files
General refactor/restructure of project (#109)
1 parent 78ecebc commit 8a4ec5f

25 files changed

+749
-1108
lines changed

.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ updates:
66
schedule:
77
interval: daily
88
time: "04:00"
9-
- package-ecosystem: pip
10-
directory: "/.github/workflows"
11-
schedule:
12-
interval: daily
13-
time: "04:00"
149
- package-ecosystem: "github-actions"
1510
directory: "/"
1611
schedule:

.github/release-drafter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name-template: "v$RESOLVED_VERSION"
3-
tag-template: "$RESOLVED_VERSION"
3+
tag-template: "v$RESOLVED_VERSION"
44
change-template: "- #$NUMBER $TITLE @$AUTHOR"
55
sort-direction: ascending
66

@@ -57,4 +57,4 @@ template: |
5757
5858
$CHANGES
5959
60-
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...$RESOLVED_VERSION
60+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/workflows/linting.yaml

Lines changed: 150 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,97 +7,170 @@ on:
77
pull_request:
88
workflow_dispatch:
99

10+
env:
11+
DEFAULT_PYTHON: "3.9"
12+
1013
jobs:
11-
precommit:
12-
name: ${{ matrix.name }}
14+
codespell:
15+
name: codespell
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: ⤵️ Check out code from GitHub
19+
uses: actions/checkout@v3
20+
- name: 🏗 Set up Poetry
21+
run: pipx install poetry
22+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
23+
id: python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ env.DEFAULT_PYTHON }}
27+
cache: 'poetry'
28+
- name: 🏗 Install workflow dependencies
29+
run: |
30+
poetry config virtualenvs.create true
31+
poetry config virtualenvs.in-project true
32+
- name: 🏗 Install Python dependencies
33+
run: poetry install --no-interaction
34+
- name: 🚀 Check code for common misspellings
35+
run: poetry run pre-commit run codespell --all-files
36+
37+
ruff:
38+
name: Ruff
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: ⤵️ Check out code from GitHub
42+
uses: actions/checkout@v3
43+
- name: 🏗 Set up Poetry
44+
run: pipx install poetry
45+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
46+
id: python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: ${{ env.DEFAULT_PYTHON }}
50+
cache: 'poetry'
51+
- name: 🏗 Install workflow dependencies
52+
run: |
53+
poetry config virtualenvs.create true
54+
poetry config virtualenvs.in-project true
55+
- name: 🏗 Install Python dependencies
56+
run: poetry install --no-interaction
57+
- name: 🚀 Run Ruff
58+
run: poetry run ruff .
59+
60+
black:
61+
name: black
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: ⤵️ Check out code from GitHub
65+
uses: actions/checkout@v3
66+
- name: 🏗 Set up Poetry
67+
run: pipx install poetry
68+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
69+
id: python
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: ${{ env.DEFAULT_PYTHON }}
73+
cache: 'poetry'
74+
- name: 🏗 Install workflow dependencies
75+
run: |
76+
poetry config virtualenvs.create true
77+
poetry config virtualenvs.in-project true
78+
- name: 🏗 Install Python dependencies
79+
run: poetry install --no-interaction
80+
- name: 🚀 Run black on docs
81+
run: poetry run blacken-docs
82+
83+
pre-commit-hooks:
84+
name: pre-commit-hooks
1385
runs-on: ubuntu-latest
14-
if: ${{ github.actor != 'dependabot[bot]' }}
15-
strategy:
16-
matrix:
17-
include:
18-
- id: bandit
19-
name: Check with bandit
20-
- id: black
21-
name: Check code style
22-
- id: blacken-docs
23-
name: Check code style in documentation
24-
- id: check-ast
25-
name: Check Python AST
26-
- id: check-case-conflict
27-
name: Check for case conflicts
28-
- id: check-docstring-first
29-
name: Check docstring is first
30-
- id: check-executables-have-shebangs
31-
name: Check that executables have shebangs
32-
- id: check-json
33-
name: Check JSON files
34-
- id: check-merge-conflict
35-
name: Check for merge conflicts
36-
- id: check-symlinks
37-
name: Check for broken symlinks
38-
- id: check-toml
39-
name: Check TOML files
40-
- id: check-yaml
41-
name: Check YAML files
42-
- id: codespell
43-
name: Check code for common misspellings
44-
- id: debug-statements
45-
name: Debug Statements and imports (Python)
46-
- id: detect-private-key
47-
name: Detect Private Keys
48-
- id: end-of-file-fixer
49-
name: Check End of Files
50-
- id: fix-byte-order-marker
51-
name: Check UTF-8 byte order marker
52-
- id: flake8
53-
name: Enforcing style guide with flake8
54-
- id: isort
55-
name: Check imports are sorted
56-
- id: poetry
57-
name: Check pyproject file
58-
- id: pylint
59-
name: Check with pylint
60-
- id: pyupgrade
61-
name: Check for upgradable syntax
62-
- id: trailing-whitespace
63-
name: Trim Trailing Whitespace
64-
- id: vulture
65-
name: Check for unused Python code
66-
- id: yamllint
67-
name: Check YAML style
6886
steps:
6987
- name: ⤵️ Check out code from GitHub
7088
uses: actions/checkout@v3
71-
- name: 🏗 Set up Python 3.9
89+
- name: 🏗 Set up Poetry
90+
run: pipx install poetry
91+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
7292
id: python
7393
uses: actions/setup-python@v4
7494
with:
75-
python-version: 3.9
76-
- name: 🏗 Get pip cache dir
77-
id: pip-cache
95+
python-version: ${{ env.DEFAULT_PYTHON }}
96+
cache: 'poetry'
97+
- name: 🏗 Install workflow dependencies
7898
run: |
79-
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
80-
- name: ⤵️ Restore cached Python PIP packages
81-
uses: actions/cache@v3
99+
poetry config virtualenvs.create true
100+
poetry config virtualenvs.in-project true
101+
- name: 🏗 Install Python dependencies
102+
run: poetry install --no-interaction
103+
- name: 🚀 Check Python AST
104+
run: poetry run pre-commit run check-ast --all-files
105+
- name: 🚀 Check for case conflicts
106+
run: poetry run pre-commit run check-case-conflict --all-files
107+
- name: 🚀 Check docstring is first
108+
run: poetry run pre-commit run check-docstring-first --all-files
109+
- name: 🚀 Check that executables have shebangs
110+
run: poetry run pre-commit run check-executables-have-shebangs --all-files
111+
- name: 🚀 Check JSON files
112+
run: poetry run pre-commit run check-json --all-files
113+
- name: 🚀 Check for merge conflicts
114+
run: poetry run pre-commit run check-merge-conflict --all-files
115+
- name: 🚀 Check for broken symlinks
116+
run: poetry run pre-commit run check-symlinks --all-files
117+
- name: 🚀 Check TOML files
118+
run: poetry run pre-commit run check-toml --all-files
119+
- name: 🚀 Check XML files
120+
run: poetry run pre-commit run check-xml --all-files
121+
- name: 🚀 Check YAML files
122+
run: poetry run pre-commit run check-yaml --all-files
123+
- name: 🚀 Check YAML files
124+
run: poetry run pre-commit run check-yaml --all-files
125+
- name: 🚀 Detect Private Keys
126+
run: poetry run pre-commit run detect-private-key --all-files
127+
- name: 🚀 Check End of Files
128+
run: poetry run pre-commit run end-of-file-fixer --all-files
129+
- name: 🚀 Trim Trailing Whitespace
130+
run: poetry run pre-commit run trailing-whitespace --all-files
131+
132+
pylint:
133+
name: pylint
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: ⤵️ Check out code from GitHub
137+
uses: actions/checkout@v3
138+
- name: 🏗 Set up Poetry
139+
run: pipx install poetry
140+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
141+
id: python
142+
uses: actions/setup-python@v4
82143
with:
83-
path: ${{ steps.pip-cache.outputs.dir }}
84-
key: pip-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }}
85-
restore-keys: |
86-
pip-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-
144+
python-version: ${{ env.DEFAULT_PYTHON }}
145+
cache: 'poetry'
87146
- name: 🏗 Install workflow dependencies
88147
run: |
89-
pip install -r .github/workflows/requirements.txt
90148
poetry config virtualenvs.create true
91149
poetry config virtualenvs.in-project true
92-
- name: ⤵️ Restore cached Python virtual environment
93-
id: cached-poetry-dependencies
94-
uses: actions/cache@v3
150+
- name: 🏗 Install Python dependencies
151+
run: poetry install --no-interaction
152+
- name: 🚀 Run pylint
153+
run: poetry run pre-commit run pylint --all-files
154+
155+
yamllint:
156+
name: yamllint
157+
runs-on: ubuntu-latest
158+
steps:
159+
- name: ⤵️ Check out code from GitHub
160+
uses: actions/checkout@v3
161+
- name: 🏗 Set up Poetry
162+
run: pipx install poetry
163+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
164+
id: python
165+
uses: actions/setup-python@v4
95166
with:
96-
path: .venv
97-
key: >-
98-
venv-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
99-
venv-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-
167+
python-version: ${{ env.DEFAULT_PYTHON }}
168+
cache: 'poetry'
169+
- name: 🏗 Install workflow dependencies
170+
run: |
171+
poetry config virtualenvs.create true
172+
poetry config virtualenvs.in-project true
100173
- name: 🏗 Install Python dependencies
101174
run: poetry install --no-interaction
102-
- name: 🚀 Run pre-commit for ${{ matrix.id }}
103-
run: poetry run pre-commit run ${{ matrix.id }} --all-files
175+
- name: 🚀 Run yamllint
176+
run: poetry run yamllint .

.github/workflows/lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Lock
44
# yamllint disable-line rule:truthy
55
on:
66
schedule:
7-
- cron: "0 9 * * *"
7+
- cron: "0 4 * * *"
88
workflow_dispatch:
99

1010
jobs:

.github/workflows/release.yaml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,31 @@ name: Release
44
# yamllint disable-line rule:truthy
55
on:
66
release:
7-
types: [published]
7+
types:
8+
- published
9+
10+
env:
11+
DEFAULT_PYTHON: "3.9"
812

913
jobs:
1014
release:
11-
name: 🚀 Releasing to PyPi
15+
name: Releasing to PyPi
1216
runs-on: ubuntu-latest
1317
steps:
1418
- name: ⤵️ Check out code from GitHub
1519
uses: actions/checkout@v3
16-
- name: 🏗 Set up Python 3.9
20+
- name: 🏗 Set up Poetry
21+
run: pipx install poetry
22+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
1723
id: python
1824
uses: actions/setup-python@v4
1925
with:
20-
python-version: 3.9
21-
- name: 🏗 Get pip cache dir
22-
id: pip-cache
23-
run: |
24-
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
25-
- name: ⤵️ Restore cached Python PIP packages
26-
uses: actions/cache@v3
27-
with:
28-
path: ${{ steps.pip-cache.outputs.dir }}
29-
key: pip-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-${{ hashFiles('.github/workflows/requirements.txt') }}
30-
restore-keys: |
31-
pip-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-
26+
python-version: ${{ env.DEFAULT_PYTHON }}
27+
cache: 'poetry'
3228
- name: 🏗 Install workflow dependencies
3329
run: |
34-
pip install -r .github/workflows/requirements.txt
3530
poetry config virtualenvs.create true
3631
poetry config virtualenvs.in-project true
37-
- name: ⤵️ Restore cached Python virtual environment
38-
id: cached-poetry-dependencies
39-
uses: actions/cache@v3
40-
with:
41-
path: .venv
42-
key: >-
43-
venv-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
44-
venv-${{ runner.os }}-v1-${{ steps.python.outputs.python-version }}-
4532
- name: 🏗 Install dependencies
4633
run: poetry install --no-interaction
4734
- name: 🏗 Set package version

.github/workflows/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Stale
44
# yamllint disable-line rule:truthy
55
on:
66
schedule:
7-
- cron: "0 8 * * *"
7+
- cron: "0 4 * * *"
88
workflow_dispatch:
99

1010
jobs:

0 commit comments

Comments
 (0)