Skip to content

Commit 43d1b89

Browse files
authored
chore: Update pyproject.toml format for lint section (#96)
* chore: Update pyproject.toml format for lint section * chore: Update pre-commit CI routine for hook compatibility * chore: Add CodeCov token to action and document usage * chore: Add CodeCov token to action and document usage
1 parent f411714 commit 43d1b89

File tree

12 files changed

+892
-661
lines changed

12 files changed

+892
-661
lines changed

.github/actions/deps/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ runs:
1010
using: "composite"
1111
steps:
1212
- name: Setup Python
13-
uses: actions/setup-python@v4
13+
uses: actions/setup-python@v5
1414
with:
1515
python-version: '${{ inputs.python-version }}'
1616

1717
- name: Cache Poetry
1818
id: cache-poetry
19-
uses: actions/cache@v3
19+
uses: actions/cache@v4
2020
with:
2121
path: ${{github.workspace}}/.poetry
2222
key: poetry-self-${{ hashFiles('.github/workflows/*.yml') }}
@@ -43,7 +43,7 @@ runs:
4343

4444
- name: Cache Dependencies
4545
id: cache-deps
46-
uses: actions/cache@v3
46+
uses: actions/cache@v4
4747
with:
4848
path: ${{github.workspace}}/.venv
4949
key: poetry-deps-${{ hashFiles('**/poetry.lock') }}
@@ -53,5 +53,6 @@ runs:
5353
if: steps.cache-deps.cache-hit != 'true'
5454
shell: bash
5555
run: |
56+
poetry env use ${{ inputs.python-version }}
5657
poetry config virtualenvs.in-project true
5758
poetry install --no-interaction

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup Dependencies
2323
uses: './.github/actions/deps'
2424
with:
25-
python-version: '3.11'
25+
python-version: '3.12'
2626

2727
- name: Run Security Check
2828
run: poetry run poe security

.github/workflows/validate.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ jobs:
1515
steps:
1616
- name: Checkout Source
1717
uses: actions/checkout@v4
18-
1918
- name: Setup Dependencies
2019
uses: './.github/actions/deps'
2120
with:
22-
python-version: '3.11'
21+
python-version: '3.12'
2322

2423
- name: Run Styling Enforcement
2524
shell: bash
@@ -33,13 +32,12 @@ jobs:
3332
name: Run Unit Tests
3433
strategy:
3534
matrix:
36-
version: ['3.8', '3.9', '3.10', '3.11']
35+
version: ['3.8', '3.9', '3.10', '3.11', '3.12']
3736
os: [ubuntu-latest]
3837
runs-on: ${{ matrix.os }}
3938
steps:
4039
- name: Checkout Source
4140
uses: actions/checkout@v4
42-
4341
- name: Setup Dependencies
4442
uses: './.github/actions/deps'
4543
with:
@@ -50,19 +48,20 @@ jobs:
5048
run: poetry run poe test
5149

5250
- name: Codecov
53-
uses: codecov/codecov-action@v3
51+
uses: codecov/codecov-action@v4
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
5454

5555
security:
5656
name: Run Security Checks
5757
runs-on: ubuntu-latest
5858
steps:
5959
- name: Checkout Source
6060
uses: actions/checkout@v4
61-
6261
- name: Setup Dependencies
6362
uses: './.github/actions/deps'
6463
with:
65-
python-version: '3.11'
64+
python-version: '3.12'
6665

6766
- name: Run Security Checks
6867
shell: bash

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ minimum_pre_commit_version: "3.0.0"
55

66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0
8+
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
99
hooks:
1010
- id: check-added-large-files
1111
- id: check-case-conflict
@@ -20,7 +20,7 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/PyCQA/bandit
23-
rev: ca4faf2f82a7c68a088100f8ba2b8e56f9bdcfe3 # frozen: 1.7.5
23+
rev: 4c5b3c81e4356001b472849b05af902064d68515 # frozen: 1.7.7
2424
hooks:
2525
- id: bandit
2626
description: 'Bandit is a tool for finding common security issues in Python code'
@@ -29,19 +29,19 @@ repos:
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version.
32-
rev: 6fcbf19c7cf351a8dc3517a0fed3ebfa05610de2 # frozen: v0.0.290
32+
rev: 1bd02b3569e3ac5cc66552b1336a96a8880d1bae # frozen: v0.2.1
3333
hooks:
3434
- id: ruff
3535
args: [ --fix, --exit-non-zero-on-fix ]
3636

3737
- repo: https://github.com/psf/black
38-
rev: e87737140f32d3cd7c44ede75f02dcd58e55820e # frozen: 23.9.1
38+
rev: e026c93888f91a47a9c9f4e029f3eb07d96375e6 # frozen: 24.1.1
3939
hooks:
4040
- id: black
4141
language_version: python3.11
4242

4343
- repo: https://github.com/pycqa/isort
44-
rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0
44+
rev: c235f5e450b4b84e58d114ed4c589cbf454175a3 # frozen: 5.13.2
4545
hooks:
4646
- id: isort
4747
name: isort

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,24 @@ poetry install
3333
```bash
3434
poetry run poe test
3535
```
36+
37+
## GitHub Actions Setup
38+
39+
### Validation Workflow
40+
41+
#### CodeCov.io
42+
43+
The workflow is automatically setup to pass along coverage reports to CodeCov.io.
44+
You must set the `CODECOV_TOKEN` secret in your repository settings.
45+
Otherwise, disable the routine in the `.github/workflows/validate.yaml` file.
46+
47+
### Publishing Workflow
48+
49+
Ensure you have Discussions enabled in your repository settings,
50+
or remove `discussion_category_name` from the `.github/workflows/publish.yaml` file.
51+
52+
#### PyPi
53+
54+
The workflow is automatically setup to publish to PyPi.
55+
You must set the `POETRY_PYPI_TOKEN_PYPI` secret in your repository settings.
56+
Otherwise, disable the routine in the `.github/workflows/publish.yaml` file.

0 commit comments

Comments
 (0)