-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Associate project dir with new virtual environment #1861
Conversation
d4216cd
to
d7335c2
Compare
This includes a workaround for pypa/pipenv#1861 that lets `pew workon foo` to change directory when invoked. Related to 0dd7b51.
Hey @meshy thanks for putting htis together, sorry for the delay! We had some issues with our testing infrastructure recently and we are just getting that sorted. Once that's straightened out I'd say we can merge this as a bolt-on for now. We can sort out the testing bit if we ever actually build out the feature in pipenv. |
Hey @techalchemy, no worries on the delay :) I'm delighted you're happy with the concept of merging this. Thanks very much! |
plz update onto master and we can resume work |
d7335c2
to
9464c3b
Compare
No worries. I've just rebased, and repushed. |
Closing in favour of Pipes for the moment. Take a look! #1824 (comment) |
Thanks for pointing me in the direction of Pipes -- it does look very nice, but I'm concerned about moving to a project that's only a little over a day old. I'll keep an eye on it though. At the moment, my work-around for this is to make the following call immediately after creating the virtualenv:
|
FWIW, this PR solves the issue that the Pipes author mentions in their follow-up tweet.
|
I have a slightly strange case where I'm generating the `.project` file myself using: echo $(pwd) > $(pipenv --venv)/.project This is to work around pypa/pipenv#1861 Unfortunately, this adds a newline char to the end of the project path, and ultimately, activating the project with `Pipes` fails, where `pew` succeeds. The error I get is: FileNotFoundError: [Errno 2] No such file or directory: '/home/charlie/code/my-project\n': '/home/charlie/code/my-project\n'
@meshy can you pull from master and rebase? |
This lets pew know which directory to switch to when activating an environment with `pew workon foo`.
5d28ac3
to
a35b157
Compare
@erinxocon rebased :) |
The tests failures are unrelated, but I think it’s best to fix them first before merging. We can’t have a release until everything’s back working anyway… |
Hi @meshy - How would this PR solve the issue? |
@gtalarico Hey!
Yes, exactly |
Thanks! |
Signed-off-by: Dan Ryan <[email protected]>
This adds a flag to
pew
that lets it know which directory to switch to when activating an environment withpew workon foo
.I really miss this feature from
virtualenvwrapper
, and I'd love still use this workflow, so if I've gone about this the wrong way, please let me know, and I'll see what I can do to make it right.This fits the workflow I'm used to, but I understand it might impact other people's workflows.
Because of that, this may be blocked waiting for the PR onpew
to add an option to prevent the directory changing when runningpew workon
, as that will offer a way to restore the existing behaviour.Update: That's been merged now.
I wasn't sure where to add tests for this particular functionality, but I'm not entirely familiar with pytest, so I might have missed something.
If there's a place you think is appropriate for the tests, or a better way to achieve this, please let me know.