-
Notifications
You must be signed in to change notification settings - Fork 181
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 site user base directory to config and data paths if site.ENABLE_USER_SITE is true #242
Conversation
…USER_SITE is true Fixes jupyter#221 This allows someone to install Jupyter components in the Python user directory (for example, with pip install —user) and Jupyter will see them.
Setting as draft since we should add better tests and documentation (for example, how to disable this directory by setting the PYTHONNOUSERSITE variable or calling python with |
@jasongrout I just had an occasion where I almost made this PR myself, so 👍 from me. |
Thanks for your review, Min! I added tests, docs, and a note in the |
@minrk - if my polishing additions look good to you, can you merge? Thanks! |
@jasongrout I see there was a comment about duplicates in data? Is that expected? |
AFAICT, the duplicate comes from this logic that is only applied to data dirs: jupyter_core/jupyter_core/paths.py Lines 90 to 102 in 6de55f5
Does this logic overlap partially/fully with that of |
It appears that the code path is if %APPDATA% is defined to be the home We can at least check for a duplicate and not add the directory if there would be a duplicate. That would at least avoid the issue of having to look twice in the same directory. |
It appears that sometimes on Windows the jupyter_data_dir is the same as the directory derived from getuserbase, so we check for the duplicate before adding a new directory. See jupyter#221 (comment) for a situation with a duplicate directory.
Done in 7a8e44c |
…ER_ENV_PATH is defined in the environment
Thanks! |
Thanks everyone! I'll make an RC for 4.9 with this PR, targeting a release for next week. |
I just released 4.9.0 to pypi. |
This allows someone to install Jupyter components in the Python user directory (for example, with
pip install —user
) and Jupyter will see them. It seems like a natural extension of our user-level directories.Fixes #221
@minrk - I'm curious what you think of this change.