Skip to content

🐛 fix(venv): seed pip into hook environments#114

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:61
Feb 18, 2026
Merged

🐛 fix(venv): seed pip into hook environments#114
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:61

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat commented Feb 18, 2026

uv venv does not install pip into virtual environments by default, unlike python -m venv. Hooks such as mypy that internally call python -m pip install at runtime (e.g. to fetch missing type stubs) fail with No module named pip in the hook environment. This affects CI environments where pre-commit-uv manages hook installation.

Passing --seed to uv venv restores pip and setuptools availability in the created environment, matching standard venv behavior and fixing any hook that depends on pip at runtime.

Fixes #61

uv venv does not install pip by default, unlike python -m venv. Hooks
like mypy that internally call `python -m pip install` to fetch type
stubs fail with "No module named pip" in the created environment.

Passing --seed to uv venv restores pip/setuptools availability,
matching standard venv behavior and fixing hooks that depend on pip
at runtime.

Fixes tox-dev#61
@gaborbernat gaborbernat added the bug Something isn't working label Feb 18, 2026
@gaborbernat gaborbernat enabled auto-merge (squash) February 18, 2026 04:49
@gaborbernat gaborbernat merged commit 77942c4 into tox-dev:main Feb 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

when run from gitlab CI, mypy does not use virtual environment

1 participant