-
Notifications
You must be signed in to change notification settings - Fork 339
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
Better (but not completely fixed) treatment of venv #904
Conversation
mcdonc
commented
Dec 18, 2023
Sorry, I thought I squashed all those commits. I suck at git. |
- get rid of requirements check for recreation - store .devenv_interpreter because the venv python binary resolves to the origin python of the wrapper, not the wrapper python In practice, merging this commit will mean that a) the invocation of pip install -r will need to take care of any changed requirements. b) the venv, once created, will never be recreated unless the Python wrapper changes. The Python wrapper doesn't seem to change when you add Python packages to your packages = list, I'm not sure what the other circumstances might be. In reality, this fix sucks because the venv is not actually based on the wrapper. The wrapper, in fact, seems to never get used. That will need to be addressed in some other commit, though.
Nice! If we can get the wrapper to be passed to the virtualenv correctly that will solve all the issues with dynamic linking :) |
I wonder, why get rid of requirements checking? I like that it would rebuild the venv if it changes and I'd expect it to. |
The particular form of requirements checking that I took out didn't make too much sense, I don't think. It checked for a literal "requirements.txt" inside the venv root, which can't really work generically. In addition (and maybe unrelatedly), I think I would prefer it if "devenv up" did not try to run pip install -r again. I think that job should be relegated to the flake rebuild. I haven't investigated why this happens yet, though. But the reason I would prefer this is because it just takes way too long on any complicated project to rerun pip install -r. |
If the venv's "python" resolves to the wrapper we won't need the |
See also my rationale at #745 (comment) |
The reason that the venv's bin/python resolves to the bin/python of the parent of the wrapper (and doesn't resolve to the wrapper's bin/python) is due to how
I actually think this might be ok because So delta the question of getting rid of the literal requirements.txt check, I think this PR is ready. EDIT (later)... uh, maybe not. Confusion reigns. I guess the whole point is to execute the wrapper as Python for its side effects. But it really can't be done without creating a custom venv builder (which is definitely possible). I don't think I quite understand what the manylinux stuff is doing under the hood. I'll try to figure it out. |
… to execute the entirety of the cmdline as a single command
I think maybe this is another reason to not pip install on devenv up. This is me starting a container that was generated via
|
It's likely I should close this PR and open several that break out the changes. |