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
Allow skipping the use of the PYTHONNOUSERSITE variable #51641
Conversation
Friendly ping on this @FRidh |
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.
I think it's fine to allow this. Some small changes needed and then target staging.
I think it's good to go now? Is there anything I need to do to target staging? |
Squash commits so we have two commits again, and then rebase onto staging. |
8ac937e
to
03b8fb8
Compare
Whoops are you sure I should have rebased onto staging? Should I change the target of this PR to staging or rebase onto master? (Sorry everyone who was just added for the spam) |
@FRidh anything else I need to do on this one or is it waiting on more review? Thanks! |
Friendly ping on this @FRidh , is it ready to land? Github is acting like there are changes requested but I think it's confused... |
I haven't looked at this in a while. I'm away now until Thursday.
…On Fri, Apr 19, 2019, 11:57 Tom McLaughlin ***@***.***> wrote:
Friendly ping on this @FRidh <https://github.com/FRidh> , is it ready to
land? Github is acting like there are changes requested but I think it's
confused...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51641 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAQHZ32CPPP7GFQNGZPGXNTPRGJQDANCNFSM4GI6DG4Q>
.
|
@FRidh could we push this one over the finish line? Thanks! |
Commit titles are incorrect, it's |
03b8fb8
to
a3f24da
Compare
Fixed |
In a followup commit, please explain the options in the Nixpkgs manual. |
You mean a followup PR? I can't add a commit here since this PR was merged. |
Created #61502 |
Motivation for this change
By default, Nix-installed Python binaries use the
PYTHONNOUSERSITE
variable (see here) to prevent Python from looking for packages in the user's site-packages directory.I wanted to be able to install a Python installation that is slightly impure, so that you can run
pip install --user some_package
and then use the resulting package. This is convenient when you want to set up an environment where the user either can't install new Python packages via Nix, or would prefer to usepip
directly (for example, if a package version isn't available on Nix).So, this PR introduces a flag
skipNoUserSite
that can be used to disable thePYTHONNOUSERSITE
setting when needed. The change happens in two places:pkgs/development/interpreters/python/mk-python-derivation.nix
andpkgs/development/interpreters/python/wrap.sh
: the change here allows you to disablePYTHONNOUSERSITE
for individual Python packages, i.e. those built bybuildPythonPackage
.pkgs/development/interpreters/python/wrapper.nix
: the change here allows you to disablePYTHONNOUSERSITE
for Python environments, i.e. those created bypython.withPackages
. It causes every wrapped binary inside the environment to be user site-packages aware.This flag is purely opt-in, so hopefully it's okay to add a little impurity for this use case :)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)