Repository navigation
fix(pkg): hash CUDA redist archives without hashlib.file_digest - #4
Merged
Merged
Conversation
pyproject.toml declares requires-python >=3.10, but cuda_redist.py used hashlib.file_digest, which was added in Python 3.11, so installing a CUDA toolkit with the tool failed with AttributeError on 3.10 after the download. Hash the archive in 1 MiB blocks instead. Test: tests/test_cuda_redist.py (no network: urlopen is faked) fails before with file_digest removed, passes after.
Contributor
|
Merged in 949c214. Thanks, this one broke the CUDA install on Python 3.10. The export that publishes this repo first landed your fix without your name on it. I've fixed the export, and your original commit is now in main's history, so this PR shows as merged under your name. |
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.
Licensing, attribution, and third-party content
and have preserved required license, copyright, attribution, and NOTICE text.
and the affected file or component (or an appropriately mapped change log).
repository's licensing and contain required third-party notices.
the Eagle Trademark Policy and preserved the required
non-affiliation and distinguishable-branding disclosures.
and any requirements stated in CONTRIBUTING.md.
Modified: 2026-10-22 by kevin9327, files: tools/cuda_redist.py, tests/test_cuda_redist.py (new). Existing copyright and SPDX headers are unchanged.
Change summary
tools/cuda_redist.pyverified each archive withhashlib.file_digest, which only exists from Python 3.11. The package declaresrequires-python = ">=3.10", so on 3.10 the tool downloadedcuda_nvccand then failed withAttributeErrorbefore installing anything. The fix hashes the archive in 1 MiB blocks, the same waytools/mk_index.pyandtools/release_files.pyalready do. Touchestools/cuda_redist.pyand addstests/test_cuda_redist.py.Testing and impact
pytest tests/test_cuda_redist.py(new; serves a fake manifest and a tiny xz archive through a patchedurlopen, no network; removeshashlib.file_digestto match 3.10): fails on main withAttributeError, passes with the fix. It also checks the archive's top directory is stripped and thelib64link is created. The digest is unchanged on 3.11+.Lint:
ruff==0.15.1 checkon the changed files passes. CPU only; no GPU, model weights or torch needed.Third-party materials and dependencies
None
AI-assisted or generated content
Grok Bot (an AI assistant) helped find the bug by reading the code, and drafted the fix, the test and this description. I reviewed the diff and ran the new test before the fix (fails) and after (passes), plus the rest of the touched test file.
Documentation and notices
None