Skip to content

Commit cb11881

Browse files
jeremymanningclaude
andcommitted
Issue #110: Restrict black pin to py>=3.9 and run linting once
Follow-up to the previous commit. Pinning black==25.1.0 unconditionally broke the Python 3.8 matrix job at install time: ERROR: Could not find a version that satisfies the requirement black==25.1.0; extra == "dev" ... No matching distribution found black 25.1.0 requires Python >=3.9. Fail-fast then cancelled the other 12 jobs, which is why they showed as failures despite only one real error. Two changes: 1. Marker the pin as `black==25.1.0; python_version >= '3.9'` so the 3.8 job installs cleanly without black. 2. Gate the black and flake8 steps on ubuntu-latest/3.11. Linting is version-independent, so running it on all 13 matrix combinations wastes CI and, more importantly, made the formatter a function of the matrix entry. This follows the convention already used by the coverage-badge steps in this workflow. Note for #113: the flake8 step passes --exit-zero, so it cannot fail and has never gated anything. Left as-is here because removing it would surface a large backlog and block this P0; recorded on #113 instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012gTBDPK16HUZ3kHQ2QyjuU
1 parent 3cd502e commit cb11881

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ jobs:
3838
python -m pip install --upgrade pip
3939
pip install -e ".[dev,test,kubernetes,widget]"
4040
41+
# Linting is version-independent, so run it once on the primary target
42+
# rather than on all 13 matrix combinations. This also keeps the black pin
43+
# off Python 3.8, which black 25.1.0 does not support (see #110).
4144
- name: Lint with black
45+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
4246
run: |
4347
black --check clustrix/ tests/
4448
4549
- name: Lint with flake8
50+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
4651
run: |
4752
flake8 clustrix/ tests/ --max-line-length=88 --extend-ignore=E203,W503,F401,E722,F541,F841,F811,E731,E501,W291,W293,F824 --exit-zero
4853

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ cloud = [
8383
dev = [
8484
"pytest>=6.0",
8585
"pytest-cov>=2.0",
86-
"black==25.1.0", # pinned - unbounded ">=" let CI pull black 26.5.1 (see #110)
86+
"black==25.1.0; python_version >= '3.9'", # pinned - unbounded ">=" let CI pull 26.5.1 (see #110)
8787
"flake8>=3.8",
8888
"mypy>=0.812",
8989
"types-PyYAML",
@@ -132,7 +132,7 @@ all = [
132132
# Development dependencies
133133
"pytest>=6.0",
134134
"pytest-cov>=2.0",
135-
"black==25.1.0", # pinned - unbounded ">=" let CI pull black 26.5.1 (see #110)
135+
"black==25.1.0; python_version >= '3.9'", # pinned - unbounded ">=" let CI pull 26.5.1 (see #110)
136136
"flake8>=3.8",
137137
"mypy>=0.812",
138138
# Documentation dependencies

0 commit comments

Comments
 (0)