-
Notifications
You must be signed in to change notification settings - Fork 182
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
Try to detect if we are in a virtual environment and change path precedence accordingly #286
Conversation
…edence accordingly. We make the assumption that if we are in a virtual environment, we should prioritize the environment-level sys.prefix over the user-level paths. The user can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection. Fixes jupyter#283
for more information, see https://pre-commit.ci
Of course, several tests fail. @gutow (or anyone else), feel free to take over this if you can. |
I am trying to pick this up. But am having trouble setting up an environment where I can run tests locally. It looks to me like line 29 of paths.py is causing the error in the CI testing:
Should be:
To be consistent with the vocabulary used previously. I get errors on running the tests that appear to be caused by isolating the tests in a virtual environment. They are not the same as occur in the github CI testing. So, I think I would have to set up a virtual machine with no virtual environments to do the tests on my local machine. I have lots of different projects on my machine, so have them all isolated in virtual environments. I definitely do not want to set this one up outside of a virtual environment. Am I on the right track here? |
…tters. Now that we have autodetection logic for when we are in a virtual env, we must explicitly set this variable to off if we expect it off.
Actually, most of the errors came from an actual bug in my code. Doh! 8b5f1c5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thanks you for this change. I look forward to the next release. I think this will help avoid problems for naive user such as myself. |
We make the assumption that if we are in a virtual environment, we should prioritize the environment-level sys.prefix over the user-level paths. The user can opt out of this behavior by setting JUPYTER_PREFER_ENV_PATH, which takes precedence over our autodetection.
Fixes #283