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
pythonPackages.nixpkgs: init at 0.2.2 #47169
Conversation
@GrahamcOfBorg eval |
cc @dotlambda |
Force-pushed to fix a trivial mistake, sorry for making it in the first place =/ |
@t184256 It would be great if you could bump this PR to the latest version. |
That's a big whoops. Force-pushed to keep it squashed. Is it better now? |
pkgs/top-level/python-packages.nix
Outdated
inherit pname version; | ||
sha256 = "0xrdk3n0jh8gwqflw9f4pj5dj43kq7ihdarmy396f95a353grp96"; | ||
}; | ||
buildInputs = with pkgs.python3Packages; [ pbr ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't reference python inputs by using pkgs.python3Packages
since python3Packages
may be pointing at a package set for a different interpreter.
This would break the following code: python35.withPackages(ps: [ ps.nixpkgs ])
since this would mix dependencies from python3.5 and python3.6.
The self
variable is pointing at the correct package set for a given interpreter so use buildInputs = with self [ pbr ]
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
@GrahamcOfBorg build python3Packages.nixpkgs |
Success on x86_64-darwin (full log) Attempted: python3Packages.nixpkgs Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: python3Packages.nixpkgs Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: python3Packages.nixpkgs Partial log (click to expand)
|
Allows to `from nixpkgs import` stuff in interactive Python sessions
This is an awesome hack! Thanks |
Allows to
from nixpkgs import
stuff in interactive Python sessionsMotivation for this change
I am a researcher and I use python and xonsh interactively a lot. While I appreciate the purity of Nix, sometimes I really want to violate it and pull in some dependency into my shell right now, without tearing my session down, editing and rebuilding an environment, and then recreating my session from history.
This module allows me to bypass all the Nix purity goodness in a whim,
from nixpkgs import
something and go on with my analysis. Yes, this is an abuse, but it's too convenient to pass up.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)