Commit graph

30 commits

Author SHA1 Message Date
Zanie Blue
c25c800367
Fix Ruff linting (#14111)
Some checks are pending
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks | walltime aarch64 linux (push) Blocked by required conditions
CI / benchmarks | instrumented (push) Blocked by required conditions
2025-06-17 17:28:23 +00:00
Zanie Blue
21986c3fc9
Bump timeout on Python download release fetch (#13955)
Failing with a 504 at
1556959077

Successful at
4384626025
2025-06-10 16:54:42 -05:00
Aria Desires
891fe524d9
update python build standalone, unblocklist linux updates (#13732) 2025-05-30 12:33:21 -04:00
Aria Desires
b93ce238a0
blocklist the linux cpython builds from 20250517 (#13617)
There is a runtime issue with some of these builds

Here is the testing I've seen ( has bug,  works):

* uv version (pbs version)
  *  uv 0.7.7 (pbs 20250521)
  *  uv 0.7.6 (pbs 20250517)
  *  uv 0.7.5 (pbs 20250409)
* os
  *  linux
  *  windows
* arch
  *  x86_64
  *  aarch64
* python version
  *  3.12
  *  3.13
  *  3.14

Fixes #13610
2025-05-23 18:15:16 -04:00
Tim Felgentreff
878c2acdf3
Add downloading of GraalPy (#13172)
## Summary

This adds GraalPy download metadata so that `uv python install graalpy`
works. See https://github.com/astral-sh/uv/issues/13114

## Test Plan

The existing integration test was changed to test this functionality.
2025-05-06 11:02:27 -05:00
Zanie Blue
b6df755c9b Omit Python 3.7 downloads from managed versions (#13022)
Removes Python 3.7 installation support.

The following are available today and would no longer be available

```
cpython-3.7.9-windows-x86_64-none                      <download available>
cpython-3.7.9-windows-x86-none                         <download available>
cpython-3.7.9-macos-x86_64-none                        <download available>
cpython-3.7.9-linux-x86_64-gnu                         <download available>
cpython-3.7.7-windows-x86_64-none                      <download available>
cpython-3.7.7-windows-x86-none                         <download available>
cpython-3.7.7-macos-x86_64-none                        <download available>
cpython-3.7.7-linux-x86_64-gnu                         <download available>
cpython-3.7.6-windows-x86_64-none                      <download available>
cpython-3.7.6-windows-x86-none                         <download available>
pypy-3.7.13-windows-x86_64-none                        <download available>
pypy-3.7.13-macos-x86_64-none                          <download available>
pypy-3.7.13-linux-x86_64-gnu                           <download available>
pypy-3.7.13-linux-x86-gnu                              <download available>
pypy-3.7.13-linux-s390x-gnu                            <download available>
pypy-3.7.13-linux-aarch64-gnu                          <download available>
pypy-3.7.12-windows-x86_64-none                        <download available>
pypy-3.7.12-macos-x86_64-none                          <download available>
pypy-3.7.12-linux-x86_64-gnu                           <download available>
pypy-3.7.12-linux-x86-gnu                              <download available>
pypy-3.7.12-linux-s390x-gnu                            <download available>
pypy-3.7.12-linux-aarch64-gnu                          <download available>
pypy-3.7.10-windows-x86_64-none                        <download available>
pypy-3.7.10-macos-x86_64-none                          <download available>
pypy-3.7.10-linux-x86_64-gnu                           <download available>
pypy-3.7.10-linux-x86-gnu                              <download available>
pypy-3.7.10-linux-s390x-gnu                            <download available>
pypy-3.7.10-linux-aarch64-gnu                          <download available>
pypy-3.7.9-windows-x86-none                            <download available>
pypy-3.7.9-macos-x86_64-none                           <download available>
pypy-3.7.9-linux-x86_64-gnu                            <download available>
pypy-3.7.9-linux-x86-gnu                               <download available>
pypy-3.7.9-linux-s390x-gnu                             <download available>
pypy-3.7.9-linux-aarch64-gnu                           <download available>
```

All the CPython ones should absolutely not be available, as they're not
even the last security patch release. I'm on the fence about PyPy?
2025-04-29 16:37:00 -05:00
Zanie Blue
553bcccb6a
Add support for dynamic musl Python distributions on x86-64 Linux (#12121)
Following the upstream release and #12120, removes gating preventing
installation of the managed musl Python versions.

Of note

- The filtering of musl Python distributions has moved from the Rust
runtime to the metadata fetcher
- The filtering is now conditional on the PBS release date, removing all
old static musl distributions
- We could support the `+static` musl downloads in the future; right
now, they are deprioritized when selecting a variant
- I added test to CI which uses Alpine and installs numpy
2025-03-11 18:14:10 -05:00
github-actions[bot]
f3fb1c5a17
Sync latest Python releases (#12120)
Automated update for Python releases.

---------

Co-authored-by: zanieb <2586601+zanieb@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-03-11 20:58:47 +00:00
Jo
c57fb4dcef
Make fetching github releases faster (#11614)
Some checks are pending
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux libc (push) Blocked by required conditions
CI / build binary | linux musl (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows x86_64 (push) Blocked by required conditions
CI / build binary | windows aarch64 (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | pydantic/pydantic-core (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / smoke test | linux (push) Blocked by required conditions
CI / smoke test | macos (push) Blocked by required conditions
CI / smoke test | windows x86_64 (push) Blocked by required conditions
CI / smoke test | windows aarch64 (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
I noticed that the latest two `sync-python-releases` jobs failed due to
`httpx.RemoteProtocolError: peer closed connection without sending
complete message body (incomplete chunked read)`.

For the current python-build-standalone release, each request page
(defaulting to 30 items per page) takes about 20 seconds and loads
around 32MB of data. This extensive data load might be causing the
request to frequently fail.

In this PR, I reduced number of items per page to 10 and added
`Accept-Encoding: gzip, deflate` to the request header. Now, it takes
about 6 seconds to load, and the compressed response size has been
reduced to 534KB. I hope this would addresses the request failure.
2025-02-19 08:57:56 -06:00
Jo
0498b9fb1d
Make fetch python downloads deterministic (#11572)
Closes #11549
2025-02-17 08:36:38 -06:00
Zanie Blue
d70160a57b
Update references to python-build-standalone to reflect the transferred project (#9977) 2024-12-17 20:19:58 +00:00
Zanie Blue
761dafd0d1
Allow download of Python distribution variants with newer CPU instruction sets (#9781)
Supersedes https://github.com/astral-sh/uv/pull/8517 with an alternative
approach of making all the variants available instead of replacing the
x86_64 (v1) variant with x86_64_v2.

Doesn't add automatic inference of the supported instructions, but that
should be doable per @charliermarsh's comment there. Going to do it as a
follow-up since this has been pretty time consuming.

e.g.,

```
❯ cargo run -q -- python install cpython-3.12.8-linux-x86_64_v3-gnu
Installed Python 3.12.8 in 2.72s
 + cpython-3.12.8-linux-x86_64_v3-gnu
```

Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2024-12-10 14:26:45 -06:00
Jo
41462e5987
Fix a typo in fetch-download-metadata.py (#8515)
Fix this typo:

98523e2014/crates/uv-python/fetch-download-metadata.py (L399)

and removed an empty line in the `downloads.inc.mustache" template.
2024-10-24 07:33:14 -05:00
Zanie Blue
824dedad76
Retain old python-build-standalone releases (#8216)
Closes https://github.com/astral-sh/uv/issues/8213

I didn't mean to remove these when updating the regular expression.
Arguably, they shouldn't be used anymore, but we should make that choice
with intention.
2024-10-15 11:08:46 -05:00
Zanie Blue
b697cee3e1
Prefer optimized builds for freethreaded Python downloads (#8196)
Addresses report in https://github.com/astral-sh/uv/issues/8194
2024-10-15 08:00:02 -04:00
Zanie Blue
5f33915e03
Add support for managed installs of free-threaded Python (#8100)
Closes https://github.com/astral-sh/uv/issues/7193

```

❯ cargo run -q -- python uninstall 3.13t
Searching for Python versions matching: Python 3.13t
Uninstalled Python 3.13.0 in 231ms
 - cpython-3.13.0+freethreaded-macos-aarch64-none
❯ cargo run -q -- python install 3.13t
Searching for Python versions matching: Python 3.13t
Installed Python 3.13.0 in 3.54s
 + cpython-3.13.0+freethreaded-macos-aarch64-none
❯ cargo run -q -- python install 3.12t
Searching for Python versions matching: Python 3.12t
error: No download found for request: cpython-3.12t-macos-aarch64-none
❯ cargo run -q -- python install 3.13rc3t
Searching for Python versions matching: Python 3.13rc3t
Found existing installation for Python 3.13rc3t: cpython-3.13.0+freethreaded-macos-aarch64-none
❯ cargo run -q -- run -p 3.13t python -c "import sys; print(sys.base_prefix)"
/Users/zb/.local/share/uv/python/cpython-3.13.0+freethreaded-macos-aarch64-none
```
2024-10-14 15:18:52 -05:00
Jo
172bff4aec
Organize downloads by prioritizing the platform, then the architecture. (#7900)
## Summary

PythonDownloadKey (cpython-3.13.0rc3-darwin-aarch64-none) and
PlatformTriple in `fetch-download-metadata.py` have a slight
inconsistency in the ordering of `os` and `arch`. In PythonDownloadKey,
`os` precedes `arch`, while in PlatformTriple, `arch` comes before
`platform` (equivalent to os). This difference in ordering affects the
sorting logic, giving arch higher priority than platform in the
`download-metadata.json` file, leading to a little bit of unexpected
order of entries.

Before:
<img width="676" alt="image"
src="https://github.com/user-attachments/assets/adb24a2e-da70-4a09-a702-4b5d71600b2c">
After:
<img width="725" alt="image"
src="https://github.com/user-attachments/assets/c6c76e6a-d3fd-43dc-bfb0-b3a4a3fe2b6b">
2024-10-03 10:51:21 -05:00
Jo
32ab2a5a95
Fix Python prerelease sorting (#7884)
## Summary

Observed from #7880, `rc3` should be sorted before `rc2`.
2024-10-03 13:03:19 +01:00
Zanie Blue
0e9870078e
Add support for managed Python 3.13 and update CPython versions (#7263)
Adds support for CPython 3.13.0rc2

Also bumps to the latest patch version of all the other CPython minor
versions we support.
2024-09-10 14:36:16 -05:00
Charlie Marsh
5d727cb0af
Deprecate the --isolated flag (#5466)
## Summary

This PR deprecates the `--isolated` flag. The treatment varies across
the APIs:

- For non-preview APIs, we warn but treat it as equivalent to
`--no-config`.
- For preview APIs, we warn and ignore it, with two exceptions...
- For `tool run` and `run` specifically, we don't even warn, because we
can't differentiate the command-specific `--isolated` from the global
`--isolated`.
2024-07-30 22:40:38 +00:00
Ben Beasley
dfb4e5bbc8
Add license text to fetch-download-metadata.py (#5587) 2024-07-30 08:15:23 -04:00
Charlie Marsh
a089e20a35
Use stripped variants by default in Python install (#5451)
## Summary

Will file a separate ticket to support `--debug`.

Closes https://github.com/astral-sh/uv/issues/5447.
2024-07-25 17:29:31 +00:00
Jo
7ddf67a72b
Add PyPy finder (#5337)
## Summary

This PR adds PyPy finder and adds PyPy to uv managed Python versions.

## Test Plan

```console
$ cargo run -- python install
```
2024-07-23 14:58:04 -05:00
Jo
43084249ee
Add mypy type check for uv-python scripts (#5332)
## Summary

Per https://github.com/astral-sh/uv/pull/4853#issuecomment-2212505407

> If we're going to aim for full type coverage, we should probably
follow this by adding type checking in CI too otherwise it seems too
easy for it to become out of date.
2024-07-23 09:14:05 -05:00
Jo
025f2f3162
Fix python-build-standalone workflow (#5327)
## Summary

The script reads `GITHUB_TOKEN` instead. And since #4853 merged, there
is no need to use `uv run --with`.
2024-07-23 08:20:36 -04:00
Jo
0a6efe4d26
Refactor fetch-download-metadata.py script (#4853)
## Summary

Similiar to https://github.com/astral-sh/rye/pull/680, I have made a
major refactor to the `fetch-download-metadata.py` script.

Some notable changes:

- Use PEP 723 inline scripts
- Fully type annotated the script
- Implemented async HTTP fetching
- Introduced a `Finder` base class and move finder logic under
`CPythonFinder` subclass, which will make it easier to add a
`PyPyFinder` later.
- Instead of fetching `xxx.sha256` for each file, the script now fetches
a single `SHA256SUMS` file containing checksums for all files in the
release.

As a result, the script now takes around 10 seconds instead of 10+
minutes.

## Plan for Future PRs

- [ ] Implement the `PyPyFinder`
- [ ] Add an GitHub Action to run `fetch-download-metadata.py` daily and
create PR automatically

## Test Plan

```sh
cargo run -- run --isolated -- ./crates/uv-python/fetch-download-metadata.py
```
2024-07-23 03:06:25 +00:00
Jo
2c214e7585
Use install_only python archive (#4843)
## Summary

Resolves #4834

## Test Plan

```sh
# 3.12.3 is a `install_only` archive
$ cargo run -- python install --preview --force 3.12.3

# 3.9.4 has only `full` archive
$ cargo run -- python install --preview --force 3.9.4
```
2024-07-06 21:43:55 -05:00
Zanie Blue
c0875fd8fe
Improvements to the Python metadata fetch script (#4780)
This fell out of my investigation of
https://github.com/astral-sh/uv/issues/4774 but the bug was fixed by the
reporter in #4775

- Adds support for `GH_TOKEN` authentication again — basically needed to
avoid rate limits when hacking on this.
- Clarifies some handling and logging of flavors
2024-07-03 11:36:59 -05:00
Di-Is
dc4ff84443
Use optimized versions of managed Python on Linux (#4775)
Fix #4774.

## Summary

Change the python interpreter for linux installed with `uv python` to an
optimized one.

## Test Plan

I ran the following command on Linux (glibc) to confirm that an
optimized (not debug built) Python is installed.

```bash
# install python
uv python install 3.12.3

# check build type
uv run python -c "import sysconfig;print(sysconfig.get_config_var('Py_DEBUG'))"
0
```
2024-07-03 10:58:04 -05:00
Zanie Blue
dd7da6af5f
Change "toolchain" to "python" (#4735)
Whew this is a lot.

The user-facing changes are:

- `uv toolchain` to `uv python` e.g. `uv python find`, `uv python
install`, ...
- `UV_TOOLCHAIN_DIR` to` UV_PYTHON_INSTALL_DIR`
- `<UV_STATE_DIR>/toolchains` to `<UV_STATE_DIR>/python` (with
[automatic
migration](https://github.com/astral-sh/uv/pull/4735/files#r1663029330))
- User-facing messages no longer refer to toolchains, instead using
"Python", "Python versions" or "Python installations"

The internal changes are:

- `uv-toolchain` crate to `uv-python`
- `Toolchain` no longer referenced in type names
- Dropped unused `SystemPython` type (previously replaced)
- Clarified the type names for "managed Python installations"
- (more little things)
2024-07-03 07:44:29 -05:00
Renamed from crates/uv-toolchain/fetch-download-metadata.py (Browse further)