-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Enable stdenv
customization through (buildPython*.override { inherit stdenv; })
#271762
Open
ShamrockLee
wants to merge
3
commits into
NixOS:master
Choose a base branch
from
ShamrockLee:python-function-override
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+43
−14
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 tasks
89f0bd1
to
279ab67
Compare
Simplify a bit. |
13 tasks
f6ddb6f
to
93fb0e3
Compare
Reword the release note entry. |
Steinhagen
reviewed
Jan 31, 2024
93fb0e3
to
c1aee27
Compare
c1aee27
to
433a127
Compare
433a127
to
4d3b925
Compare
13 tasks
Fix `makeOverridablePythonPackage` in python-package-base.nix and unshadow `buildPython*.override`. This makes it possible to override the dependencies of buildPython*. E.g., `buildPythonPackage.override { unzip = unzip-custom; }` returns a derived version of `buildPythonPackage` with the `unzip` package overridden with `unzip-custom`.
4d3b925
to
62fce45
Compare
<function>.override
and enable stdenv
customization through (buildPython*.override { inherit stdenv; })
stdenv
customization through (buildPython*.override { inherit stdenv; })
13 tasks
8a648bc
to
6ced5d4
Compare
13 tasks
6ced5d4
to
50053fe
Compare
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.topic: python
8.has: documentation
This PR adds or changes documentation
10.rebuild-darwin: 1-10
10.rebuild-darwin: 1
10.rebuild-linux: 1-10
10.rebuild-linux: 1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
This PR brings the missing
.override
back tobuildPythonPackage
andbuildPythonApplication
, and allow specifying thestdenv
used by the build helpers throughbuildPython*.override
(as most build helpers do) instead of passing it intobuildPython*
.The reason to move to
buildPythonPackage.override { stdenv = ...; }
frombuildPythonPackage { stdenv = ...; }
includes:The
buildPython* { inherit stdenv; ...; }
will be impossible/unfeasible when taking fixed-point arguments (buildPython* (finalAttrs: { ...; })
).lib.extendMkDerivation
is on its way, but we need a clean ground to integrate it intobuildPython*
.stdenv
is a dependencybuildPythonPackage
would (directly or indirectly) get frompkgs
throughcallPackage
. It makes better sense to change it through the.override
attribute provided bycallPackage
.In the future, we could get rid of all the special, impassable arguments, and pass everything properly either into
stdenv.mkDerivation
or throughpassthru
. This way, we only needoverrideAttrs
to override attributes, without having to defined special overriders likeoverridePythonAttrs
and for each language and framework.stdenv
could neither be passed intostdenv.mkDerivation
or throughpassthru
, sincestdenv.mkDerivaiton
will add astdenv
attribute to the resulting derivation.For package definition that used to be:
can now become
In the future, when
buildPythonPackage
also takes fixed-point arguments, we could write:This PR depends on #366593.
Initial effort for #271387.
Things done
nixos-install-tools
)nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Priorities
Add a 👍 reaction to pull requests you find important.