-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat/venv convergence #273
base: main
Are you sure you want to change the base?
Conversation
9680774
to
27f759f
Compare
1e027d0
to
353e89f
Compare
353e89f
to
29ad3de
Compare
Initial env exploration
Installing packages
Running python
Enable the virtualenvifying codepath
Upgrading tracked python versions
|
CC @airportyh
|
Another consideration is the Nix channel in .replit: a different channel will give you different version of the same major-minor version of Python. Currently the Pythons that come from nixmodules isn't dependent on the Nix channel in .replit, and we've just upgraded Python to unstable. Not sure if we want to change that in the future. |
We also have older Python templates which have a |
This will not be a problem: # Don't patch if VIRTUAL_ENV doesn't match our .pythonlibs
# If the user is managing their own venv, don't touch it.
if os.environ.get("VIRTUAL_ENV") != pythonlibs:
return False |
This raises another problem. This is pushing me back towards
|
Why
.pythonlibs
can be made into a proper virtualenv with a few minor edits, most of which are fairly fault tolerant.What changed
Add to
sitecustomize
some logic to determine whether we need to heal the.pythonlibs
directory. This, combined with two envvars () lets us get rid of all of the other python envvars (
PYTHONHOME
,PYTHONNOUSERSITE
, etc), as well as making the following work:Test plan
Rollout
There are some considerations here.
First, I am explicitly not setting
VIRTUAL_ENV
in this PR. There are a handful of repls out in the wild that gotVIRTUAL_ENV
in their.replit
during the period of time it was in the public template, which is regrettable, so I'll let Ask know to keep an eye out.Second, users may have voluntarily set
VIRTUAL_ENV
to.pythonlibs
and established their own venv there. If that's the case, we don't touch it.Third, we might consider rolling this out to explorers first, though if they encounter a bug and want to revert, their
.pythonlibs
will not get un-converted, so they'll still need help getting working again in that case.