Repository navigation
Type-check the scripts on the newest supported Python - #524
Merged
Merged
Conversation
FlorentinD
force-pushed
the
fix-style-docs-imports
branch
2 times, most recently
from
November 23, 2026 16:52
6307d4a to
c43c271
Compare
`Python - Check code style` fails on `main` because the scripts import the `docs` dependency group, which installs Sphinx and nbsphinx only on Python 3.13+ (Sphinx 9.1+ requires it), while that job lints on the oldest supported Python. Installing the group there resolves to nothing, which is what the earlier attempt assumed was enough. The scripts are dev tooling rather than library code, so a `code-style-scripts` job type-checks them on the newest supported Python (3.15) with the group installed. The mypy config skips the directory for the oldest-Python job, and the new job names the files, since `exclude` applies to a directory target as well. `MYPYPATH` resolves the test harness that the notebook scripts import from `python-wrapper/tests`. `--group docs` on `code-style` goes: it is a no-op on 3.11 and the group belongs to the new job.
FlorentinD
force-pushed
the
fix-style-docs-imports
branch
from
November 23, 2026 17:03
c43c271 to
efae84a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python - Check code stylefails onmain, with three errors inscripts/sphinx_container_pandoc.py:The job lints on Python 3.11, but the scripts import the
docsdependency group, which installs Sphinx and nbsphinx only on Python 3.13+ (Sphinx 9.1+ requires it). An earlier attempt added--group docsto that job's sync, which resolves to nothing there — every entry in the group is gated on the interpreter version — so the job still fails. The line is dropped again here.The scripts are dev tooling rather than library code, and the
justfileruns them from auv-managed environment, so they are type-checked on the newest supported Python instead. A newcode-style-scriptsjob does that on 3.15 with thedocsgroup installed, andcode-stylekeeps linting the library on the oldest supported Python, which is where 3.11 compatibility is checked.The mypy config skips
scripts/for the oldest-Python job. The new job names the files rather than the directory, sinceexcludeapplies to a directory target as well, and setsMYPYPATHso the test harness the notebook scripts import frompython-wrapper/testsresolves.Considerations: the scripts are no longer type-checked against Python 3.11. They are run from a
uv-managed venv rather than by end users, andclean_notebooks.pyis still executed by the 3.11 job for the notebook formatting check, so an actual 3.11 incompatibility there would still fail. If the scripts should gate merges,code-style-scriptsmay need adding to the required checks.