uv/crates/uv-python
Jo dac3161f90
Check hash of downloaded python toolchain (#4806)
## Summary

Check the sha256 checksum when downloading a managed python toolchain.

## Test Plan

```sh
$ 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
```
2024-07-04 17:49:12 +00:00
..
python Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
src Check hash of downloaded python toolchain (#4806) 2024-07-04 17:49:12 +00:00
Cargo.toml Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
download-metadata.json Use optimized versions of managed Python on Linux (#4775) 2024-07-03 10:58:04 -05:00
fetch-download-metadata.py Improvements to the Python metadata fetch script (#4780) 2024-07-03 11:36:59 -05:00
template-download-metadata.py Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00