Skip to content

🐛 fix(ci): resolve ty type-check failures#3837

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:ci
Feb 27, 2026
Merged

🐛 fix(ci): resolve ty type-check failures#3837
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:ci

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

The type and type-min CI jobs have been failing across all platforms because the ty type checker correctly identified that system_executable on virtualenv's PythonInfo is typed as str | None, which cannot be passed directly to Path(). Additionally, cached_py_info.PythonInfo was never a public attribute of that module — it needs to be imported from virtualenv.discovery.py_info instead, and from_exe returns PythonInfo | None rather than PythonInfo.

The fix narrows the None case with a walrus-operator guard in _get_python (returning None early, which the method already supports), moves the cached_py_info and PythonInfo imports into get_virtualenv_py_info where they're actually used, and raises a clear RuntimeError when from_exe returns None. 🔧 The test is narrowed with an assert.

Also fixes the check.yaml workflow matrix exclude which still referenced the stale windows-latest alias instead of windows-2025, so the docs job was unintentionally running on Windows.

@gaborbernat gaborbernat added the type:internal should have no impact on the user (refactoring, infrastructure, tools, etc.) label Feb 27, 2026
@gaborbernat gaborbernat force-pushed the ci branch 2 times, most recently from c1f3468 to 65aa504 Compare February 27, 2026 15:33
The ty type checker flagged `system_executable` as `str | None` which
can't be passed directly to `Path()`. Guard against `None` in
`_get_python` and narrow with an assert in the test.

`cached_py_info.PythonInfo` was never a public attribute of that module;
import it from `virtualenv.discovery.py_info` instead and handle the
`None` return from `from_exe`.

Also fix the check workflow matrix exclude which referenced the stale
`windows-latest` alias instead of `windows-2025`, causing docs to run
on Windows unintentionally.
@gaborbernat gaborbernat enabled auto-merge (squash) February 27, 2026 15:48
@gaborbernat gaborbernat disabled auto-merge February 27, 2026 16:07
@gaborbernat gaborbernat merged commit a9533f5 into tox-dev:main Feb 27, 2026
27 checks passed
@gaborbernat gaborbernat deleted the ci branch March 9, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided type:internal should have no impact on the user (refactoring, infrastructure, tools, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant