Skip to content
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

create a fetchpypi function thats using blake2b for the crypto hash (python) #21637

Closed
RonnyPfannschmidt opened this issue Jan 4, 2017 · 17 comments

Comments

@RonnyPfannschmidt
Copy link
Contributor

the modern pypi cdn hashes files using blake2b, which is also part of their url
so it would be very practical to reuse those hashes for file checking and full url building

@grahamc
Copy link
Member

grahamc commented Jan 4, 2017

Unfortunately those hashes are checked by nix itself, and we'd need to add blake2b to nix.

@FRidh
Copy link
Member

FRidh commented Jan 4, 2017

@RonnyPfannschmidt Do you have a link to documentation of how the hashes are computed?

@LnL7
Copy link
Member

LnL7 commented Jan 9, 2017

I have some nix expressions for creating python packages from a custom index, this uses pip with --require-hashes to handle the downloads. I could probably generalise this a bit to create a fetchpypi function that only needs a sha and pypi index.

@RonnyPfannschmidt
Copy link
Contributor Author

im closing this one as unsustainable since sha256 are available as well as name based redirects

@FRidh
Copy link
Member

FRidh commented Jan 29, 2017

As far as I know the name-based redirects don't work with wheels though, and I think we're going more in the direction of using wheels.

@RonnyPfannschmidt
Copy link
Contributor Author

@LnL7
Copy link
Member

LnL7 commented Jan 29, 2017

This is what I've been using to download python packages from a custom index https://gist.github.com/LnL7/e87c76d1bf4217dcdc8226bcec1e71c1.
Removing --no-binary :all: would make this use wheels by default.

@RonnyPfannschmidt
Copy link
Contributor Author

@FRidh that being said, using wheels as source package implies killing the ability to run tests in many ways

but it could be valuable to set up a bootstrap tool-chain using downloaded wheels in the pythonpath

@FRidh
Copy link
Member

FRidh commented Jan 29, 2017

@FRidh that being said, using wheels as source package implies killing the ability to run tests in many ways

Indeed, we would still have to fetch the tests elsewhere then. I'm not a big fan of it, but as it is likely setuptools will be used fewer in the future, developers will sometimes only upload wheels.

This is what I've been using to download python packages from a custom index https://gist.github.com/LnL7/e87c76d1bf4217dcdc8226bcec1e71c1.
Removing --no-binary :all: would make this use wheels by default.

That's a good idea, using pip as fetcher.

@LnL7
Copy link
Member

LnL7 commented Jan 29, 2017

I'll create a pr that integrates it.

@FRidh
Copy link
Member

FRidh commented Jan 29, 2017

@LnL7 If we can just use fetchurl that would be even better #22256 (comment)

@LnL7
Copy link
Member

LnL7 commented Jan 29, 2017

That only works for pypi.python.org, I created the expression so I could use our internal pypi server at work.

@FRidh
Copy link
Member

FRidh commented Jan 29, 2017

That I understand, having a generic function is nice to have. For use in Nixpkgs I would prefer we use a lighter-weight fetchurl though.

@LnL7
Copy link
Member

LnL7 commented Jan 29, 2017

Sure, perhaps we could swap out the implementation depending on if a custom index is used? It would be nice if I could use some of the existing packages in nixpkgs.

@LnL7
Copy link
Member

LnL7 commented Jan 29, 2017

Since fetchpypi and fetchurl are both fixed output drvs, the implementation should not matter for the output.

@RonnyPfannschmidt
Copy link
Contributor Author

@LnL7 most pypi servers have some form of simple redirect as far as i recall, perhaps you can get by with a sinmple fetchurl wrapper as well

an pip using function would be still nice as building block for complex setups

@grahamc
Copy link
Member

grahamc commented Jan 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants