🐛 fix(ci): resolve ty type-check failures#3837
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 27, 2026
Merged
Conversation
c1f3468 to
65aa504
Compare
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.
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.
The
typeandtype-minCI jobs have been failing across all platforms because the ty type checker correctly identified thatsystem_executableon virtualenv'sPythonInfois typed asstr | None, which cannot be passed directly toPath(). Additionally,cached_py_info.PythonInfowas never a public attribute of that module — it needs to be imported fromvirtualenv.discovery.py_infoinstead, andfrom_exereturnsPythonInfo | Nonerather thanPythonInfo.The fix narrows the
Nonecase with a walrus-operator guard in_get_python(returningNoneearly, which the method already supports), moves thecached_py_infoandPythonInfoimports intoget_virtualenv_py_infowhere they're actually used, and raises a clearRuntimeErrorwhenfrom_exereturnsNone. 🔧 The test is narrowed with an assert.Also fixes the
check.yamlworkflow matrix exclude which still referenced the stalewindows-latestalias instead ofwindows-2025, so thedocsjob was unintentionally running on Windows.