Fix Python workflow not running specified version#453
Open
AndrewADev wants to merge 4 commits intoJij-Inc:mainfrom
Open
Fix Python workflow not running specified version#453AndrewADev wants to merge 4 commits intoJij-Inc:mainfrom
AndrewADev wants to merge 4 commits intoJij-Inc:mainfrom
Conversation
Fix an issue where the Python workflow was not running the specified Python version due to it not being accepted by the version of setup-uv that was previously in use. Then migrate away from uv workspaces for the examples, since they will only ever resolve a single version of python, which causes conflicts with the requires-python specifier of "3.12" listed in the type-statement-alias example (can't find an interpreter in the 3.10, 3.11 run contexts). Lastly, add new tasks to cover adding and bumping packages to compensate for the drudgery of not having workspaces.
Fix a syrupy test for newer API and generate snapshot file in new format.
Fix an issue where an unused extension, which was not listed as a dependency, was crashing a doc-test, since the package couldn't be found.
The cache created by uv is never written to for rust-only workflows, which was leading to a crash when the cleanup step tried removing a non-existent directory.
d63f5bb to
ef0e25c
Compare
Contributor
Author
AndrewADev
commented
Apr 25, 2026
| [dependency-groups] | ||
| dev = ["myst-parser", "sphinx", "sphinx-rtd-theme"] | ||
| dev = [ | ||
| "mypy==1.19.1", |
Contributor
Author
There was a problem hiding this comment.
This is to avoid pulling in changes to the main stub generation code as part of this PR.
The fix for the issue with newer versions of mypy (1.20+) is available in a separate PR: #452
| description: "Python version to install" | ||
| required: false | ||
| default: "3.10" | ||
| enable-uv-cache: |
AndrewADev
commented
Apr 25, 2026
Comment on lines
-19
to
-23
| "sphinxcontrib.katex", | ||
| ] | ||
|
|
||
| myst_enable_extensions = [ | ||
| "dollarmath", |
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.



Summary
Fix an issue where the Python workflow was not running the specified Python version due to it not being accepted by the version of setup-uv that was previously in use (trying to update just a couple actions is what lead me here).
Then migrate away from uv workspaces for the examples, since uv will only ever resolve a single version of python, which causes conflicts with the requires-python specifier of "3.12" listed in the type-statement-alias example (it fails to find an interpreter in the 3.10, 3.11 run contexts). Also add new tasks to cover adding and bumping packages to compensate for the drudgery of not having workspaces.
Lastly, follow-up on any breakages that resulted from fresh resolution of packages and updated versions.
Background
Currently, the main Python test workflow is not running the version of Python specified in the matrix.
This can be seen when looking at the logs. Here, for instance, using 3.12 when the matrix combination intends to target 3.10:
Or when it is supposed to be using 3.13:
Support for specifying
python-versionin thesetup-uvaction wasn't added untilv4.1.0, so the place where the python version is passed is ignored.This also shows up as warning in the summary, since it is using an unexpected input for v3 of the action:
Unfortunately, simply upgrading leads to a failure, as
uvresolves the intersection of variousrequires-pythonversions:From the uv workspaces documentation
Which then leads to issues with the tests for python < 3.12, since uv can no longer satisfy the combined requirements.
In light of this, the changes in this PR propose moving away from workspaces for the examples, maintaining
uvfor package management, but with example-specificuv.lockfiles (and thus more isolated contexts).