Skip to content
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

pipenv: Ignore Python site-packages #59050

Merged
merged 1 commit into from Apr 11, 2019
Merged

Conversation

Kaali
Copy link

@Kaali Kaali commented Apr 6, 2019

pipenv nix wrapper contains a PYTHONPATH which has some dependencies
for pipenv installed. pipenv by default uses site-packages when
resolving packages, which means that any package that is included in
the nix wrapper is satisfied when running pipenv install.

But when the actual virtualenv created by pipenv is activated, it
doesn't contain those packages anymore and fails to import them.

pipenv has a flag PIP_IGNORE_INSTALLED which can be used to ignore
site-packages. Which fixes the problem of having different resolved
packages when running pipenv and when running the virtualenv.

Motivation for this change

See issue #59049

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pipenv nix wrapper contains a PYTHONPATH which has some dependencies
for pipenv installed. pipenv by default uses site-packages when
resolving packages, which means that any package that is included in
the nix wrapper is satisfied when running `pipenv install`.

But when the actual virtualenv created by pipenv is activated, it
doesn't contain those packages anymore and fails to import them.

pipenv has a flag PIP_IGNORE_INSTALLED which can be used to ignore
site-packages. Which fixes the problem of having different resolved
packages when running pipenv and when running the virtualenv.
@FRidh
Copy link
Member

FRidh commented Apr 7, 2019

cc maintainer @berdario

@FRidh FRidh merged commit 11d491d into NixOS:master Apr 11, 2019
@mweinelt
Copy link
Member

Please backport to 19.03, it also fixes issues there.

@Kaali Kaali deleted the pipenv-fix-site-packages branch April 11, 2019 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants