-
Notifications
You must be signed in to change notification settings - Fork 336
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
python: avoid using existing virtual env or poetry binary #552
python: avoid using existing virtual env or poetry binary #552
Conversation
Seems to still have the same failure |
This is needed as tools like poetry looks for VIRTUAL_ENV and attempts to use the python interpreter from this environment. We want poetry to use the python interpreter from PATH (set by devenv). We want it to configure the python interpreter for the new venv.
a06ebb3
to
d11d8db
Compare
I had a hard time understanding what was going wrong. I think it's a combination: It seems that all examples (that I run using inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
devenv:
url: /home/bob.vanderlinden/projects/devenv/src/modules Next it seemed as it poetry would default to using a different Python version than what was in I had a hard time getting stable results from the tests, as there are numerous factors that affect the test:
Might need to look into the tests for a solution. |
8d05615
to
d11d8db
Compare
Could you try rerunning CI? |
Yay, it succeeds now 👍 Just MySQL that is still failing. |
Thanks for your patience |
Thanks for fixing this :) |
Currently
poetry
is called in one instance with justpoetry
. There were cases where the poetry binary fromdevenv
's root project leaked into the devenv of the python-poetry test. This often is not a problem, but in this case it was a poetry version that was built against a different glibc, resulting in an error.I've tried to harden the poetry module a bit more by explicitly calling all executables to avoid leakage of executables from a parent environment.
While debugging also found a minor issue when manually executing poetry after removing
.venv
, poetry will create a new.venv
directory. In this case devenv should remove it and create a new symlink. This is whatln -sf
was meant to do, however it instead created a symlink inside the.venv
directory. I tried to avoid this by using--no-target-directory
.Lastly, this resets the
VIRTUAL_ENV
so that poetry won't try to usepython
from aVIRTUAL_ENV
that was already active before devenv shell started.