python-poetry / python-poetry/poetry
(π) `env use system` outputs an incorrect/confusing message "Deactivating virtualenv"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- Poetry version: 1.2.2
- Python version: 3.11.0
- OS version and name: Windows 21H2
- pyproject.toml: nah
- [π] I am on the latest stable Poetry version, installed using a recommended method.
- [π] I have searched the issues of this repo and believe that this is not a duplicate.
- [π] I have consulted the FAQ and blog for any relevant entries or release notes.
- [π] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) 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.
π poetry env info
Virtualenv
Python: 3.10.8
Implementation: CPython
Path: C:\Users\AMONGUS\projects\test\.venv
Executable: C:\Users\AMONGUS\projects\test\.venv\Scripts\python.exe
Valid: True
System
Platform: win32
OS: nt
Python: 3.10.8
Path: C:\Users\AMONGUS\AppData\Local\Programs\Python\Python310
Executable: C:\Users\AMONGUS\AppData\Local\Programs\Python\Python310\python.exe
π poetry env use system
Deactivating virtualenv: C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11
π $Env:VIRTUAL_ENV; py -0p
C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11
* C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11\Scripts\python.exe
-V:3.11 C:\Users\AMONGUS\AppData\Local\Programs\Python\Python311\python.exe
-V:3.10 C:\Users\AMONGUS\AppData\Local\Programs\Python\Python310\python.exe
π poetry env info
Virtualenv
Python: 3.11.0
Implementation: CPython
Path: C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11
Executable: C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11\Scripts\python.exe
Valid: True
System
Platform: win32
OS: nt
Python: 3.11.0
Path: C:\Users\AMONGUS\AppData\Local\Programs\Python\Python311
Executable: C:\Users\AMONGUS\AppData\Local\Programs\Python\Python311\python.exe
β 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?
π poetry env use system
Deactivating virtualenv: C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs\test-aYKTyqIq-py3.11
Is this supposed to mean something? or is this a defect and it shouldn't be showing?
TODO:
- raise another issue regarding the undefined behaviour when you do
poetry env use <path to venv>.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing poetry env use system while a virtual environment is active, then compare its output with poetry env info before and after the command. Trace the command's deactivation message and determine what wording accurately reflects the environment selection; done means the output is no longer misleading and the behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100