Repository navigation
ci: unbreak CI — venv cache restore, mypy 3.12 target, ruff 0.16.3 format - #362
Merged
Merged
Conversation
The setup-python composite action restored `.venv` from cache and treated any existing directory as usable (`if [ -d ".venv" ]`). A cached venv's `bin/python` symlinks to a hosted-Python interpreter path; when that path changes (Python patch bump, setup-uv install-dir change) the symlink breaks, and the directory check still passes, so `uv pip install` fails with "Broken symlink at .venv/bin/python3". Once the shared cache entry is poisoned it recurs on every run via restore-keys until eviction, red-lining unrelated PRs and main pushes. Validate that the restored interpreter actually executes; recreate the venv (rm -rf + `uv venv`) when it is missing or broken. The fast path (valid cache -> skip) is unchanged. Claude-Session: https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd
numpy >=2.5 ships type stubs using PEP 695 `type` statements, which mypy
rejects under a 3.11 target ("Type statement is only supported in Python
3.12 and greater"), halting the whole check. This was masked on main by
the broken-venv cache and surfaced once setup was fixed.
Bump [tool.mypy] python_version to 3.12. The project's own code
type-checks clean, and 3.11 runtime support stays covered by the Backend
Test matrix (requires-python = ">=3.11" is unchanged).
Claude-Session: https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd
The lock-file maintenance bump moved ruff to 0.16.3, which reflows ```python code blocks in the docs (collapsing short multi-line calls, adding trailing commas, blanking between methods). No semantic changes; this only realigns three Markdown files with the new formatter so `ruff format --check` passes in CI. Claude-Session: https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd
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.
Three coupled fixes that together restore a green CI. Each unmasks the next, so
they land as one PR.
1. Broken-venv cache restore (
setup-pythonaction)The action restored
.venvfrom the Actions cache and treated any existingdirectory as usable (
if [ -d ".venv" ]). A cached venv'sbin/pythonsymlinksto a hosted-Python interpreter path; when that path changes (Python patch bump,
or the setup-uv v10 install-dir change) the symlink breaks, the directory check
still passes, and the next step fails:
Once the shared cache is poisoned it recurs every run via
restore-keysuntileviction — red-lining the main push CI on
b1b7750and blocking lock-maintenancePR #360. Fix: trust the cache only if the interpreter actually executes;
otherwise recreate the venv. Fast path unchanged.
2. mypy vs numpy 2.5 stubs
With setup fixed, mypy ran and failed: numpy ≥2.5 ships stubs using PEP 695
typestatements that mypy rejects under a 3.11 target. Fix: set[tool.mypy] python_version = "3.12". Project code checks clean; 3.11 runtimestays covered by the Backend Test matrix (
requires-python = ">=3.11"unchanged).3. ruff 0.16.3 formatting
With mypy fixed,
ruff format --checkfailed: the lock bump moved ruff to0.16.3, which reflows the embedded ```python blocks in three Markdown docs.
Fix: reformat those files with 0.16.3. No semantic changes.
This PR's own green CI — which restores the same poisoned cache and installs the
same bumped toolchain — is the end-to-end proof.
https://claude.ai/code/session_017N6LZRKsJYXcNMQZqeEvpd