Repository navigation
Pass --python sys.executable to the uv download fallback - #14064
Open
vshalpnjabi wants to merge 1 commit into
Open
vshalpnjabi wants to merge 1 commit into
vshalpnjabi wants to merge 1 commit into
Conversation
uv pip install without --python cannot find an unactivated uv venv and exits 2. Target the running interpreter, as the pip branch does. Fixes explosion#14055
This branch has not been deployed
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.
Description
python -m spacy downloadfails with exit 2 in a uv-created venv that isn'tactivated. When pip isn't available,
_get_pip_install_cmd()falls back to["uv", "pip", "install"]with no--python, so uv can't find theenvironment ("No virtual environment found").
This passes
--python sys.executableso uv installs into the runninginterpreter, the same target the pip branch uses (
sys.executable -m pip).Activated venvs still work, since
--pythontakes precedence overVIRTUAL_ENV.Fixes #14055
Tested on Linux, Python 3.12.3, uv 0.13.6:
cd / && env -u VIRTUAL_ENV /tmp/v/bin/python -m spacy download en_core_web_smexits 2 with "No virtual environment found".
python -m pytest spacy/tests/test_cli.py: 121 passed, 4 skipped.ruff checkandruff format --checkon the touched files.Types of change
Bug fix
Checklist