Open KotlinIsland opened 1 year ago
What poetry env use
does is undefined here; poetry env use system
without an existing env and poetry env use <path to venv>
are undefined; this command is only meant to be with a 'real' Python. I believe we currently dereference virtual environments, and in general the behavior here is not validated or tested.
We probably should either rename the command to be poetry env create
or figure out semantics for using it with virtual environments.
The correct way to use an external virtual environment with Poetry is to activate it or manually set VIRTUAL_ENV=/path/to/venv
, and then use Poetry as normal.
@neersighted Ohhhhhh, that explains a lot...
I would expect that env use system
would always use the system version of python and never an active venv, WDYT?, comment below.
I would expect that env use system would always use the system version of python
Could the documentation be clearer? Here's what the help text says
Usage: env use [options] [--] \<python>
Arguments: python The python executable to use.
I don't myself see how that would encourage poetry env use system
, but if you want to propose a merge request to make things clearer I expect that would be welcome
@dimbleby env use system
is from the docs: https://python-poetry.org/docs/managing-environments/#switching-between-environments
If you want to disable the explicitly activated virtual environment, you can use the special
system
Python version to retrieve the default behavior
Hmm, and upon reading that again, makes me think that it's supposed to do what I thought, I'll have to take another look at this...
@neersighted Can you take another look at this please, I've changed the OP to focus on the part that looks incorrect.
-vvv
option) and have included the output below.Issue
poetry env use system
(when a venv is active) has a confusing message in the output that looks incorrect.β HUUUUH β
Why did it output 'deactivating virtualenv', the active virtualvenv (poetry 3.11) is still active, and
poetry env
is now set to 3.11?Is this supposed to mean something? or is this a defect and it shouldn't be showing?
TODO:
poetry env use <path to venv>
.