-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --here option for pew workon to prevent current directory to be changed #180
Conversation
Thank you What is the use case? If you created the venv yourself, probably you can simply avoid creating it as a project if you don't want the I guess this could be useful if you're working on a shared machine, but I fail to see exactly the need for this. Also, I haven't checked, but I think that |
Basically, this PR allows the workflow "cd into the right directory; then enable venv with no cd" where one had to follow "enable venv with cd; cd into the right directory". As, most of the time, I first open a terminal in the right directory and then I enable the environment, I thought it could be interesting to add this option to Another way of seeing this PR is to consider it as a way to allow a "default path" for a venv, with an easy way to reuse a single venv for different purpose. |
Sorry, I haven't merged this yet. I still feel a bit wavering about this, I hoped that in the last couple of weeks someone would chime in and give his perspective on this, if they'd think this would be useful or not. |
No problem, I understand;) |
FWIW, I'd like this. At the moment, when Having this flag available on |
I see, this makes sense. Thinking more about it, while the Rather than having a flag to restore the default behavior, maybe it would've been better to have a Alas, the choice has been made (mostly because pew started just as a virtualenvwrapper reimplementation) and breaking compatibility for something like this is an even worse idea |
I think you're right. Ideally, the It's pretty late for me, so this might just be me sleep-typing, but I have an idea that might work: We could transition to this better behaviour by always creating an extra file in the virtual environments (eg: When Otherwise, when Oh, and |
Actually, thinking about it more, in light of pypa/pipenv#1824, perhaps it would be of use to populate a single file in |
There is another possible advantage to having a new file format for this information (a single-file or one-per-project doesn't matter) -- each project could individually configure if it should switch by default. I have no idea if that's something people would use though. |
Yup, anyhow let's stick to the minimal implementation for now. I merged it, and just added a couple of |
This PR implements #179.
It adds an optional argument for
pew workon
(--here
) that prevents the current directory to be changed.