`poetry exit` to safely exit the virtualenv
See original GitHub issueAdd a poetry exit command to exit a poetry shell; do so safely when the poetry shell is not active already. Since exit will exit a bash shell when a poetry shell is not active, it’s “dangerous”. At present, there are issues asking for some form of “marker” that a poetry shell is active (i.e. there seems to be no easy way to tell whether or not a poetry shell is active without issuing another poetry shell to get poetry feedback about it). A poetry exit command is an additional feature that provides a safe exit, regardless of whether a poetry shell is active or if the status of it is visible.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Method to Exit Poetry Virtual Environment #2792 - GitHub
So if I deactivate or delete the existing virtual environment and create a new one with virtualenv , do I then need to...
Read more >Poetry | Dev Cheatsheets - Michael Currin
Activate environment. This creates a subshell, so when you exit the subshell no changes are persisted. $ poetry shell.
Read more >How to leave/exit/deactivate a Python virtualenv - Stack Overflow
This exits the entire shell the venv is in, and drops you back to the original shell from before the activation script made...
Read more >Configure a virtual environment | PyCharm Documentation
The main purpose of virtual environments is to manage settings and dependencies of a particular project regardless of other Python projects. virtualenv tool ......
Read more >Rebuilding a Virtualenv - PythonAnywhere help
1) Use a requirements.txt file to record what packages you're using¶ · Activate your virtualenv, using source /home/myusername/path/to/virtualenv/bin/activate or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I could see the utility in your suggestion @darrenleeweber ; though maybe, “poetry shell --exit”? I don’t think it needs another top-level command. Then if Poetry-subshell was not already active, it can print a warning, but still exit-0-OK.
I’m not sure if it helps, but what I find myself doing is:
using the preview version of poetry. This activates the virtualenv in my current shell which gives me the prompt indicator as well as the option to call
deactivateas with any virtual environment.