Skip to content

Commit ee98777

Browse files
committed
Update linting, bump deps
1 parent f833d12 commit ee98777

File tree

8 files changed

+519
-503
lines changed

8 files changed

+519
-503
lines changed

.flake8

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
[flake8]
22
max-line-length=100
3-
docstring-convention=all
43
import-order-style=pycharm
54
application-import-names=ppg_log,tests
65
extend-ignore=
7-
P102,B311,W503,E203,E226,S311,
8-
# Missing Docstrings
9-
D100,D104,D105,D107,
10-
# Docstring Whitespace
11-
D203,D212,D214,D215,
12-
# Docstring Quotes
13-
D301,D302,
14-
# Docstring Content
15-
D400,D401,D402,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D416,D417,
16-
# Type Annotations
6+
# pycodestyle
7+
E203,E226,
8+
# flake8-annotations
179
ANN002,ANN003,ANN101,ANN102,ANN204,ANN206,
18-
# pep8-naming
19-
N802,N806,N815,
2010
extend-exclude=
2111
.venv,
2212
per-file-ignores =
23-
ppg_log/db.py: D101 D103 D106,
24-
tests/test_*.py: D101 D103 E501,
25-
tests/checks.py: D103,
26-
extend-immutable-calls =
27-
# Typer CLI
28-
typer.Option, typer.Argument,
13+
tests/test_*.py: E501,

.github/workflows/lint_test.yml

+22-8
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
17+
- name: Install Poetry for caching
18+
run: pipx install poetry
1719
- name: Set up Python
1820
uses: actions/setup-python@v4
1921
with:
2022
python-version: '3.x'
23+
cache: 'poetry'
2124

2225
- name: Install dependencies
2326
run: |
@@ -33,13 +36,24 @@ jobs:
3336
runs-on: ubuntu-latest
3437
strategy:
3538
matrix:
36-
python-version: ["3.10", "3.11"]
39+
python-version: ["3.10", "3.11", "3.12", "3.13-dev"]
3740
fail-fast: false
3841

3942
steps:
40-
- uses: actions/checkout@v3
41-
- name: Set up Python ${{ matrix.python-version }}
43+
- uses: actions/checkout@v4
44+
- name: Install Poetry for caching
45+
run: pipx install poetry
46+
47+
- name: Set up (release) Python ${{ matrix.python-version }}
4248
uses: actions/setup-python@v4
49+
if: "!endsWith(matrix.python-version, '-dev')"
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
cache: 'poetry'
53+
54+
- name: Set up (deadsnakes) Python ${{ matrix.python-version }}
55+
uses: deadsnakes/action@v3.1.0
56+
if: endsWith(matrix.python-version, '-dev')
4357
with:
4458
python-version: ${{ matrix.python-version }}
4559

@@ -52,7 +66,7 @@ jobs:
5266
run: tox
5367

5468
- name: Cache coverage for ${{ matrix.python-version }}
55-
uses: actions/upload-artifact@v3
69+
uses: actions/upload-artifact@v4
5670
with:
5771
name: cov_py${{ matrix.python-version }}
5872
path: .coverage
@@ -62,14 +76,14 @@ jobs:
6276
needs: test
6377

6478
steps:
65-
- uses: actions/checkout@v3
79+
- uses: actions/checkout@v4
6680
- name: Set up Python
6781
uses: actions/setup-python@v4
6882
with:
6983
python-version: '3.x'
7084

7185
- name: Pull coverage workflow artifacts
72-
uses: actions/download-artifact@v3
86+
uses: actions/download-artifact@v4
7387
with:
7488
path: cov_cache/
7589

@@ -87,7 +101,7 @@ jobs:
87101
coverage html
88102
89103
- name: Publish cov HTML
90-
uses: actions/upload-artifact@v3
104+
uses: actions/upload-artifact@v4
91105
with:
92106
path: htmlcov/
93107
name: cov_report_html

.github/workflows/pypi_release.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Set up Python
1515
uses: actions/setup-python@v4
1616
with:
@@ -22,8 +22,14 @@ jobs:
2222
pip install poetry
2323
poetry build
2424
25-
- name: Publish package
25+
- name: Publish to PyPI
2626
uses: pypa/gh-action-pypi-publish@release/v1.5
2727
with:
2828
user: __token__
2929
password: ${{ secrets.pypi_api_token }}
30+
31+
- name: Upload wheel to release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run:
35+
gh release upload ${{ github.event.release.tag_name }} ./dist/ppg_log-*.whl

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ repos:
1717
- id: flake8
1818
additional_dependencies:
1919
- flake8-annotations
20-
- flake8-bugbear
21-
- flake8-docstrings
22-
- flake8-fixme
23-
- pep8-naming
2420
- repo: https://github.com/pre-commit/pre-commit-hooks
2521
rev: v4.6.0
2622
hooks:
@@ -38,3 +34,7 @@ repos:
3834
- id: python-check-blanket-noqa
3935
- id: python-check-blanket-type-ignore
4036
- id: python-use-type-annotations
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.5.1
39+
hooks:
40+
- id: ruff

.ruff.toml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
line-length = 100
2+
fix = false
3+
output-format = "grouped"
4+
5+
extend-exclude = [
6+
"__pycache__",
7+
".cache",
8+
]
9+
10+
[lint]
11+
select = [
12+
"B", # flake8-bugbear
13+
"C4", # flake8-comprehensions
14+
"D", # pydocstyle/flake8-docstrings
15+
"F", # Pyflakes
16+
"FIX", # flake8-fixme
17+
"N", # pep8-naming
18+
]
19+
20+
ignore = [
21+
# pydocstyle
22+
"D100",
23+
"D104",
24+
"D105",
25+
"D107",
26+
"D203",
27+
"D212",
28+
"D214",
29+
"D215",
30+
"D301",
31+
"D400",
32+
"D401",
33+
"D402",
34+
"D404",
35+
"D405",
36+
"D406",
37+
"D407",
38+
"D408",
39+
"D409",
40+
"D410",
41+
"D411",
42+
"D412",
43+
"D413",
44+
"D414",
45+
"D416",
46+
"D417",
47+
# pep8-naming
48+
"N802",
49+
"N806",
50+
"N815",
51+
]
52+
53+
[lint.flake8-bugbear]
54+
extend-immutable-calls = [
55+
"typer.Option",
56+
"typer.Argument",
57+
]
58+
59+
[lint.per-file-ignores]
60+
"ppg_log/db.py" = [
61+
"D101",
62+
"D103",
63+
"D106",
64+
]
65+
"tests/test_*.py" = [
66+
"D101",
67+
"D103",
68+
]
69+
"tests/checks.py" = [
70+
"D103",
71+
]

0 commit comments

Comments
 (0)