Python: add buildPythonPackage.overridePythonPackage method.#24155
Closed
FRidh wants to merge 4 commits intoNixOS:stagingfrom
Closed
Python: add buildPythonPackage.overridePythonPackage method.#24155FRidh wants to merge 4 commits intoNixOS:stagingfrom
FRidh wants to merge 4 commits intoNixOS:stagingfrom
Conversation
Mic92
reviewed
Mar 21, 2017
doc/languages-frameworks/python.md
Outdated
Member
Author
There was a problem hiding this comment.
Absolutely!
Actually, I would like to get all of them in 17.03 :)
Member
Author
There was a problem hiding this comment.
(Which is why I kept them together now)
Mic92
reviewed
Mar 21, 2017
doc/languages-frameworks/python.md
Outdated
Mic92
reviewed
Mar 21, 2017
doc/languages-frameworks/python.md
Outdated
Member
There was a problem hiding this comment.
A more practical example:
pandas = super.pandas.overridePythonPackage(old: rec {
version = "0.19.1";
src = super.fetchPypi {
pname = "pandas";
inherit version;
sha256 = "08blshqj9zj1wyjhhw3kl2vas75vhhicvv72flvf1z3jvapgw295";
};
});
Member
Author
There was a problem hiding this comment.
Hmm, I thought my example (and yours) was working but now it doesn't...
Did you try it?
Member
Author
There was a problem hiding this comment.
I can use .overridePythonPackage inside say python-packages.nix but not in a separate shell.nix.
FRidh
commented
Mar 21, 2017
pkgs/top-level/python-packages.nix
Outdated
Member
Author
There was a problem hiding this comment.
Note that this is basically a copy of lib.makeOverrable.
This allows one to always override the call to `buildPythonPackage`.
The following example renamed `pandas` to `foo`:
```
with import <nixpkgs> {};
(let
python = let
packageOverrides = self: super: {
pandas = super.pandas.overridePythonPackage(old: {name="foo";});
};
in pkgs.python35.override {inherit packageOverrides;};
in python.withPackages(ps: [ps.pandas])).env
```
because they're only supposed to be used in `buildPythonPackage`
Member
Author
|
This doesn't function. I'll have a look at it later. |
7 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows one to always override the call to
buildPythonPackage.The following example renamed
pandastofoo:Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)Closes #24154.