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

Get sha256, size and md5 from direct url package. #742

Open
ruben-arts opened this issue Jun 10, 2024 · 0 comments
Open

Get sha256, size and md5 from direct url package. #742

ruben-arts opened this issue Jun 10, 2024 · 0 comments

Comments

@ruben-arts
Copy link
Collaborator

ruben-arts commented Jun 10, 2024

The current implementation for direct urls (#725) downloads the url to cache and then gets the package record from the index.json. This puts the sha256, md5 and size to None as we can't currently get this info from the unpacked file in cache.

This should be fixed as these values are part of the matchspec and do exist.

This is also very important information to create "safe" lockfiles which can check these hashes for integrity of the package.

baszalmstra added a commit that referenced this issue Jun 13, 2024
Implements:
- [x] Creating "virtual" repodata from a single package file
- [x] Makes the matchspec parsing invalid if the url is not a conda
archive style name. e.g. `foo-1.2.3-bsle9f2_0.conda`
- [x] Matches a matchspec on: `Matchspec::url ==
PackageRecord::direct_url`
- [x] Adds a "fake" entry in the `PackageRecord` for a `direct_url` to
keep track in the record that it came from a direct url and which one.

Future improvements:
- We now fetch the required package to the cache and then read the
`index.json` from there. We could possible stream the package in and
only get what we need before we do the solve.
- It would be great to support "any" name package file. e.g.
`/home/user/pacakge/test.bla` and read the info from it as part of the
matchspec generation.
- We don't have all information in the package record from the
index.json, issue: #742

---------

Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant