Skip to content

Commit 8a85a61

Browse files
Technologicatclaude
andcommitted
Split lint into its own job on Python 3.14
Flake8 must run on a Python that supports all syntax in the codebase (e.g. except* requires 3.11+). The test matrix still covers 3.10+. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8c7d004 commit 8a85a61

1 file changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@ on:
1212
branches: [ master ]
1313

1414
jobs:
15-
build:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v6
19+
- name: Set up Python
20+
uses: actions/setup-python@v6
21+
with:
22+
# Use latest Python so flake8 can parse all syntax (e.g. except* requires 3.11+)
23+
python-version: "3.14"
24+
- name: Install flake8
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install flake8
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --config=flake8rc --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
flake8 . --config=flake8rc --count --exit-zero --max-complexity=100 --max-line-length=127 --statistics
1634
35+
test:
36+
needs: lint
1737
runs-on: ubuntu-latest
1838
strategy:
1939
matrix:
@@ -28,14 +48,7 @@ jobs:
2848
- name: Install tools in CI venv
2949
run: |
3050
python -m pip install --upgrade pip
31-
pip install flake8
3251
pip install pdm
33-
- name: Lint with flake8
34-
run: |
35-
# stop the build if there are Python syntax errors or undefined names
36-
flake8 . --config=flake8rc --count --select=E9,F63,F7,F82 --show-source --statistics
37-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38-
flake8 . --config=flake8rc --count --exit-zero --max-complexity=100 --max-line-length=127 --statistics
3952
- name: Determine Python version string for PDM
4053
run: |
4154
echo "TARGET_PYTHON_VERSION_FOR_PDM=${{ matrix.python-version }}" | tr - @ >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)