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: execute pythonImportsCheckPhase in subshell #80595

Merged
merged 1 commit into from Feb 20, 2020

Conversation

jonringer
Copy link
Contributor

@jonringer jonringer commented Feb 20, 2020

Motivation for this change
Execute in subshell so that the cwd returns back
to the original directory. This is important as
it enables pythonImportsCheck to work with checkPhase

pretty much you had to do doCheck = false; or else the checkPhase (or setuptoolsCheckPhase) would run and burn because setup.py (or test paths) were no longer available

good example is: #80444 (comment)

Tested that:

  • fails when an import isn't available
  • succeeds when it is
  • is able to be ran with a checkPhase
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

Execute in subshell so that the cwd returns back
to the original directory. This is important as
it enables pythonImportsCheck to work with checkPhase
@jonringer
Copy link
Contributor Author

@GrahamcOfBorg build requests

@jonringer
Copy link
Contributor Author

@GrahamcOfBorg build python3Packages.requests
@GrahamcOfBorg build pythonPackages.requests
@GrahamcOfBorg build python38Packages.requests

@jonringer jonringer merged commit cd97c05 into NixOS:staging Feb 20, 2020
@jonringer jonringer deleted the python-imports-check-subshell branch February 20, 2020 06:30
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

1 participant