pypa / virtualenv

Virtual Python Environment builder
https://virtualenv.pypa.io
MIT License
4.8k stars 1.03k forks source link

Virtualenv should support workon command by default. #2689

Open Almas-Ali opened 7 months ago

Almas-Ali commented 7 months ago

What's the problem this feature will solve?

We can activate a virtualenv by just typing workon env_name. This feature exists in some other virtual environment packages in Pypi. But I think this feature should in this package as well.

Describe the solution you'd like

This will help to active an environment easy with just a command and will be same for Windows and Linux or Mac as well. No more multiple commands for different operating system.

We can add a entry_points script name workon and add activation commands built in to that.

gaborbernat commented 7 months ago

How would this workon behave? How does it know what to activate?

Almas-Ali commented 7 months ago

For example you have an environment .venv you can use workon .venv to activate it. Behind the sean it detects the OS and set the path automatically. I can give it a pull request, if the maintainers agrees to do so.

gaborbernat commented 7 months ago

PR welcome. Just make sure to implement it for all shells we support, with tests. IMHO one of the big challenges will be how to detect and adapt it to each shell.