feat: support Windows Python venv executables in pytest/mypy/pip-audit#54
Merged
thefourcraft merged 2 commits intoproductionfrom May 4, 2026
Merged
Conversation
Windows virtualenvs place tool binaries under .venv/Scripts/<tool>.exe rather than .venv/bin/<tool>. All three Python runners now check both paths via a shared venv_tool() helper in runners/python_venv.rs: 1. POSIX path (.venv/bin/<tool>) is preferred when it exists 2. Windows path (.venv/Scripts/<tool>.exe) is checked second 3. Falls back to PATH when neither local path exists has_pytest_cov coverage detection also uses venv_tool() so Windows venvs get coverage metrics too.
has_pytest_cov was POSIX-only for site-packages scanning. It now also checks .venv/Lib/site-packages/pytest_cov (Windows venv layout) when .venv/Scripts/pytest.exe is present, so coverage metrics are reported on Windows the same way they are on POSIX.
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
Windows virtualenvs place tool binaries at
.venv\Scripts\<tool>.exerather than.venv/bin/<tool>. All three Python runners (pytest,mypy,pip-audit) were only checking the POSIX path and would miss locally-installed tools on Windows.src/runners/python_venv.rs::venv_tool(root, name)tries POSIX first, then Windows, returnsNoneto fall back to PATHis_available,run, andhas_pytest_covin all three runners now usevenv_toolinstead of hard-coded.venv/bin/pathsTest plan
pytest
available_via_windows_scripts_exe—.venv/Scripts/pytest.exemakesis_availablereturn truerun_uses_windows_venv_pytest_exe—run()passes.venv/Scripts/pytest.exeas the commandmypy
available_via_windows_scripts_exe—.venv/Scripts/mypy.exemakesis_availablereturn truerun_uses_windows_venv_mypy_exe—run()passes.venv/Scripts/mypy.exeas the commandpip-audit
available_via_windows_scripts_exe—.venv/Scripts/pip-audit.exemakesis_availablereturn truerun_uses_windows_venv_pip_audit_exe—run()passes.venv/Scripts/pip-audit.exeas the commandAll 746 tests pass (including existing POSIX and PATH fallback tests)
cargo clippy --bin barzel -- -D warningscleangit diff --check production..HEADclean