-
Notifications
You must be signed in to change notification settings - Fork 11
Fix pip in shell for uv/virtualenv-based python #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
blast-hardcheese
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard to maintain the matrix of different environments we support. This looks OK. We should definitely template-tester as well as verify agent uv flow
Co-authored-by: Devon Stewart <[email protected]>
|
@blast-hardcheese After finding an edge case that didn't work with the logic in |
blast-hardcheese
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good
Why
Currently if a repl is based on uv + virtualenv, pip install doesn't work because we have a global
PIP_CONFIG_FILEsetting which forces--useroption for pip installs, but that fails in virtualenvs. This breaks some packages which usepython -m pip installinternally like https://spacy.io/ but also breakspython -m pip installin general.What changed
sitecustomize.pyto see if the python executable is coming from the virtualenv.pythonlibs. If so: remove thePIP_CONFIG_FILEentry from the environment. This allowspython -m pip install ...to work in both the virturalenv and the non-virtualenv cases.Test plan
a. Create a python repl
b.
rm -fr .pythonlibsc.
pip install -U spacyd.
python -m spacy download en_core_web_sma. Create a new python repl
c.
uv syncd.
pip install -U spacye.
python -m spacy download en_core_web_smpython -m pip install coloramawith the same above 2 cases.Rollout