You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've moved away .venv, which was pointed at by $VIRTUAL_ENV, and had run poetry install in a new shell already, where $VIRTUAL_ENV was not set anymore.
Running poetry show in the old shell with the non-existing $VIRTUAL_ENV resulted in:
% poetry show
The virtual environment found in …/project/.venv seems to be broken.
Recreating virtualenv project-EfzD9vF2-py3.9 in …/.cache/pypoetry/virtualenvs/project-EfzD9vF2-py3.9
…
Re-creating (or rather emptying) the existing virtualenv is not necessary in this case, and causes confusion when using poetry run foo then later, where foo gets used from the system, since it is not installed again yet in the virtualenv.
I think the idea with $VIRTUAL_ENV being used and virtualenvs.in-project = null is that it would be used in this case, but when $VIRTUAL_ENV points at something non-existing it should be considered to be unset (i.e. get ignored).
(I could also imagine that it would actually re-create it, but then it should re-create what VIRTUAL_ENV points at, since that is what is going to be used the next time around again.)
When using an invalid $VIRTUAL_ENV it causes the existing virtualenv to be re-created/emptied:
% VIRTUAL_ENV=/does/not/exist poetry install
The virtual environment found in /does/not/exist seems to be broken.
Recreating virtualenv test-poetry-EM-dhAoD-py3.9 in /home/user/.cache/pypoetry/virtualenvs/test-poetry-EM-dhAoD-py3.9
Installing dependencies from lock file
I've moved away
.venv
, which was pointed at by$VIRTUAL_ENV
, and had runpoetry install
in a new shell already, where$VIRTUAL_ENV
was not set anymore.Running
poetry show
in the old shell with the non-existing$VIRTUAL_ENV
resulted in:Re-creating (or rather emptying) the existing virtualenv is not necessary in this case, and causes confusion when using
poetry run foo
then later, wherefoo
gets used from the system, since it is not installed again yet in the virtualenv.I think the idea with
$VIRTUAL_ENV
being used andvirtualenvs.in-project = null
is that it would be used in this case, but when$VIRTUAL_ENV
points at something non-existing it should be considered to be unset (i.e. get ignored).(I could also imagine that it would actually re-create it, but then it should re-create what
VIRTUAL_ENV
points at, since that is what is going to be used the next time around again.)Using poetry 1.1.7.
Related: #3353
The text was updated successfully, but these errors were encountered: