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

Check hash of downloaded python toolchain #4806

Merged
merged 2 commits into from
Jul 4, 2024

Conversation

j178
Copy link
Contributor

@j178 j178 commented Jul 4, 2024

Summary

Check the sha256 checksum when downloading a managed python toolchain.

Test Plan

$ cargo run -- python install 3.12

warning: `uv python install` is experimental and may change without warning.
Looking for installation Python 3.12.3 (any-3.12.3-any-any-any)
Downloading cpython-3.12.3-windows-x86_64-none
Installed Python 3.12.3 to C:\Users\jo\AppData\Roaming\uv\data\python\cpython-3.12.3-windows-x86_64-none
Installed 1 installation in 6s

$ cargo run -- python uninstall 3.12

$ # manually change the hash in `crates/uv-python/src/downloads.inc`

$ cargo run -- python install 3.12

warning: `uv python install` is experimental and may change without warning.
Looking for installation Python 3.12 (any-3.12-any-any-any)
Downloading cpython-3.12.3-windows-x86_64-none
error: Hash mismatch for `cpython-3.12.3-windows-x86_64-none`

Expected:
xx

Computed:
776568c92c5f3b47dbf5f17c1c58578f70d75a32654419a158aa8bdc6f95b09a

@zanieb
Copy link
Member

zanieb commented Jul 4, 2024

Exciting to see this! Thank you :)

@j178 j178 force-pushed the check-hash branch 2 times, most recently from 7041ffc to a0b76fd Compare July 4, 2024 15:28
@j178 j178 marked this pull request as ready for review July 4, 2024 15:37
@zanieb
Copy link
Member

zanieb commented Jul 4, 2024

@j178 Don't worry about those Windows stack overflows we're investigating that separately.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks great! Tested it too.

@charliermarsh charliermarsh enabled auto-merge (squash) July 4, 2024 17:39
@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality security labels Jul 4, 2024
@charliermarsh charliermarsh merged commit dac3161 into astral-sh:main Jul 4, 2024
47 checks passed
@j178 j178 deleted the check-hash branch July 5, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants