-
-
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
pythonPackages.fetchpypi: fetch tarballs from pypi #20481
Conversation
Until we have I could integrate it into the |
This function grabs the url, version and hash for a specified package from a file that was generated by update-hashes.
{ | ||
"Cycler": { | ||
"sha256": "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8", | ||
"url": "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz", |
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.
We can get rid of the urls by relying on the translator.
@@ -2456,13 +2458,10 @@ in { | |||
}; | |||
|
|||
cycler = buildPythonPackage rec { |
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.
I found buildPyPIPackage
cool, because it can set meta
, name
and version
attributes on its own.
Is there a reason for not using this approach?
|
||
let | ||
data = builtins.fromJSON (builtins.readFile filename); | ||
in pname: fetchurl {url=data.${pname}.url; sha256=data.${pname}.sha256; meta.version=data.${pname}.version;} |
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.
How about?
in pname: with data.${pname}; fetchurl { inherit url sha256; meta.version = version;}
I'm not sure, but it could probably make a difference in performance, when the hash lookup only have to be done once.
@Mic92 thanks for the review. As I wrote in #16005 we cannot use an external repo yet, because nix stable doesn't yet have fetchTarball with hash support. Even so, we could use the method with |
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/
)This function grabs the url, version and hash for a specified package from a file that was generated by update-hashes.