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

python: Fix invalid pip call in setuptoolsShellHook #69232

Merged
merged 1 commit into from Sep 22, 2019

Conversation

seppeljordan
Copy link
Contributor

@seppeljordan seppeljordan commented Sep 22, 2019

Motivation for this change

Hi, I was developing my python project when I came across the following error message:

$ nix-shell
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing setuptools-check-hook
Executing setuptoolsShellHook

Usage:   
  /nix/store/k0igqpz995nmxwf6piyd5jjpcc7gcnyc-python3-3.7.4/bin/python3.7 -m pip <command> [options]

no such option: -e
Finished executing setuptoolsShellHook

This PR addresses the issue with 2 changes: In the responsible hook we tried to call

pip -e

As far as I can tell the author of this code wanted to install the package that the user is currently working on as an "editable" into a temporary directory. This is why this patch calls instead

pip install -e

which "makes the error go away".

Why staging?

I submitted this to staging as I guess a change at this low level will trigger a mass rebuild. I am happy to resubmit this targeting another branch if desired.

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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@worldofpeace
Copy link
Contributor

If this is on stable, we'll for sure need to backport it.

@seppeljordan
Copy link
Contributor Author

If this gets accepted, I'll submit a backport version if necessary.

@FRidh FRidh added the 0.kind: regression Something that worked before working no longer label Sep 22, 2019
Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was indeed a regression, thanks!

@FRidh FRidh added the 9.needs: port to stable A PR needs a backport to the stable release. label Sep 22, 2019
@FRidh FRidh merged commit 5505d2f into NixOS:staging Sep 22, 2019
@FRidh
Copy link
Member

FRidh commented Sep 22, 2019

I've backported it as well to staging-19.09.

@seppeljordan
Copy link
Contributor Author

Sweet. Thank you.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-shell-on-a-python-package-gives-a-pip-error/4137/2

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

4 participants