-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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: add buildPythonPackage.overridePythonPackage method. #26155
Conversation
@FRidh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @alexeymuranov, @bennofs, @Azulinho and @FRidh to be potential reviewers. |
This is a follow-up of #24155. |
This allows one to always override the call to `buildPythonPackage`. In the following example we create an environment where we have the `blaze` package using an older version of `pandas`. We override first the Python interpreter and pass `packageOverrides` which contains the overrides for packages in the package set. ``` with import <nixpkgs> {}; (let python = let packageOverrides = self: super: { pandas = super.pandas.overridePythonPackage(old: rec { version = "0.19.1"; name = "pandas-${version}"; src = super.fetchPypi { pname = "pandas"; inherit version; sha256 = "08blshqj9zj1wyjhhw3kl2vas75vhhicvv72flvf1z3jvapgw295"; }; }); }; in pkgs.python35.override {inherit packageOverrides;}; in python.withPackages(ps: [ps.blaze])).env ```
I've pushed 345b35c to master. |
@FRidh sorry that I didn't comment earlier, but wouldn't it be better to name this function |
@bennofs I thought it would be good not to shadow any of the current names. |
@FRidh right, didn't think of the shadowing when I wrote that comment. But perhaps then, |
to better fit the existing naming scheme. #26155 (comment)
This allows one to always override the call to
buildPythonPackage
.In the following example we create an environment where we have the
blaze
package using an older version ofpandas
. We override first the Python interpreter and passpackageOverrides
which contains the overrides for packages inthe package set.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)