Skip to content

Release 0.13.0 - #22092

Merged
zanieb merged 18 commits into
mainfrom
release/0.13.0
Oct 9, 2026
Merged

zanieb merged 18 commits into
mainfrom
release/0.13.0

Conversation

@zanieb

@zanieb zanieb commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

No description provided.

zanieb added a commit that referenced this pull request Sep 30, 2026
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes #20791. Targets `release/0.13.0` for #22092.
@astral-sh-bot

astral-sh-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 33
  • Removed tests: 11
  • Changed suites: 9
uv-build-backend: +1 / -1

Added:

  • uv-build-backend::tests::built_by_uv_building_tokio_tar

Removed:

  • uv-build-backend::tests::built_by_uv_building_tar_codec
uv-client: +7 / -0

Added:

  • uv-client::cached_client::tests::cache_trailer_corruption_is_rejected
  • uv-client::cached_client::tests::interrupted_policy_writes_never_accept_a_mixed_policy
  • uv-client::cached_client::tests::payload_and_policy_share_an_aligned_buffer
  • uv-client::cached_client::tests::policy_can_grow_and_shrink_in_place
  • uv-client::cached_client::tests::policy_pointers_cannot_reference_the_payload
  • uv-client::httpcache::control::tests::archived_cache_control_preserves_optional_values
  • uv-client::httpcache::tests::archived_response_timing_preserves_optional_values

Removed: none

uv-client::it: +6 / -1

Added:

  • uv-client::it::cached_client::delayed_revalidation_cannot_modify_replaced_payload
  • uv-client::it::cached_client::overlapping_policy_updates_are_refetched
  • uv-client::it::cached_client::reject_invalid_cache_lengths
  • uv-client::it::cached_client::revalidation_of_readonly_entry
  • uv-client::it::cached_client::revalidation_updates_only_policy
  • uv-client::it::cached_client::torn_policy_is_refetched

Removed:

  • uv-client::it::cached_client::reject_overflowing_cache_policy_length
uv-distribution: +2 / -6

Added:

  • uv-distribution::archive::tests::round_trip_current_archive
  • uv-distribution::source::revision::tests::serialize_revision_id_as_string

Removed:

  • uv-distribution::archive::tests::deserialize_legacy_archive
  • uv-distribution::archive::tests::deserialize_uv_0_12_archive
  • uv-distribution::archive::tests::serialize_archive_for_legacy_reader
  • uv-distribution::source::revision::tests::deserialize_legacy_nanoid_revision
  • uv-distribution::source::revision::tests::deserialize_uv_0_12_revision
  • uv-distribution::source::revision::tests::serialize_revision_for_legacy_reader
uv-platform: +3 / -1

Added:

  • uv-platform::arch::tests::test_arch_sorting_for_os
  • uv-platform::arch::tests::test_arch_sorting_prefers_native
  • uv-platform::tests::test_windows_sorting_prefers_native_arch

Removed:

  • uv-platform::tests::test_windows_sorting_always_prefers_x86_64
uv-pypi-types: +2 / -0

Added:

  • uv-pypi-types::simple_json::tests::hash_digest_archive_normalizes_uppercase
  • uv-pypi-types::simple_json::tests::hash_digest_archive_rejects_invalid_digests

Removed: none

uv-python-managed: +1 / -0

Added:

  • uv-python-managed::downloads::tests::windows_aarch64_download_selection

Removed: none

uv::pip_install: +5 / -0

Added:

  • uv::pip_install::pip_install::install_reject_nested_editable_constraint
  • uv::pip_install::pip_install::install_reject_unnamed_nested_editable_constraint
  • uv::pip_install::pip_install::install_require_hashes_in_nested_constraints_txt
  • uv::pip_install::pip_install::requirement_file_paths_from_environment
  • uv::pip_install::pip_install::requirement_file_paths_with_spaces

Removed: none

uv::python: +6 / -2

Added:

  • uv::python::venv::create_venv_keeps_distutils_patch_on_py39
  • uv::python::venv::create_venv_preserves_existing_distutils_patch
  • uv::python::venv::create_venv_skips_distutils_patch_on_py310
  • uv::python::venv::create_venv_with_removed_distutils_patch_preview
  • uv::python::venv::seed_keeps_distutils_patch_on_py39
  • uv::python::venv::seed_skips_distutils_patch_on_py310

Removed:

  • uv::python::venv::create_venv_preview_keeps_distutils_patch_on_py39
  • uv::python::venv::create_venv_preview_skips_distutils_patch_on_py310_plus

charliermarsh pushed a commit that referenced this pull request Oct 1, 2026
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes #20791. Targets `release/0.13.0` for #22092.
@codspeed

codspeed Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 54 untouched benchmarks
⏩ 54 skipped benchmarks1


Comparing release/0.13.0 (b225c74) with main (238d6ba)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

zanieb added a commit that referenced this pull request Oct 7, 2026
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes #20791. Targets `release/0.13.0` for #22092.
zanieb and others added 7 commits October 9, 2026 15:50
Add an unreleased `0.13.0` section so the breaking changes can carry
their release notes as they are introduced.
Move the `0.12.x` release notes into `changelogs/0.12.x.md` and keep a
link from `CHANGELOG.md`. The archived releases use the same ascending
order as the earlier series.
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes #20791. Targets `release/0.13.0` for #22092.
Tar archives still use `astral-tokio-tar` unless the `tar-codec` preview
feature is enabled. Make `tar-codec` the default for extraction,
`uv_build` source distributions, and publishing metadata, with
`UV_LEGACY_TAR_BACKEND=1` available for workflows that need the previous
backend. Resolve the tar choice once per build context, download
operation, or publishing session and pass it through archive operations.
Document the stricter archive handling in the `0.13.0` changelog.
Native ARM64 builds of uv currently prefer emulated x86-64 Python on
Windows. Prefer native `aarch64` Python across Python versions, with
`x86_64` ahead of 32-bit `x86` when no native distribution is available.
Explicit architecture requests continue to select emulated Python.

Ports astral-sh#2207 and adds the 0.13 breaking-change entry.

Land #22098 and #22099 on `main` first, then
bring them into the 0.13 release before landing this change. They
provide the persistent `UV_PYTHON_ARCH=x86_64` opt-out and retain
compatible x86-64 wheels for Windows ARM environment markers.
Reapplies #22052 for 0.13.

We now update the HTTP cache policy in place on a 304 response, avoiding
a rewrite of the cached payload. The format change bumps the six cache
buckets containing HTTP responses.

Original benchmarks from #22052 on Linux/ext4, with 96 entries and 16
concurrent requests per batch (`c9dab42be` → `1562e401b`, using
SeaHash):

| Warm-cache workload | Main | PR | Paired change |
|---|---:|---:|---:|
| 304 refresh, 256 KiB | 80.39 ms | 9.84 ms | 87.4% faster |
| 304 refresh, 1 MiB | 323.20 ms | 17.59 ms | 94.6% faster |
| Fresh reads, 4 KiB | 0.711 ms | 0.712 ms | Approximately unchanged |
| Fresh reads, 256 KiB | 2.140 ms | 2.112 ms | 2.9% faster |
| Fresh reads, 1 MiB | 7.529 ms | 7.698 ms | No clear difference |
charliermarsh and others added 9 commits October 9, 2026 15:50
Reapplies #22059 for 0.13.

We store source-distribution revision IDs as `uv_fastid::Id`, avoiding
the `String` allocation when creating or cloning them. IDs still
serialize as strings.

The `sdists-v10` bump allows us to reject legacy 21-character IDs.
Reapplies #22060 for 0.13.

We serialize `HashDigest` directly with Serde and rkyv, removing the
legacy `HashDigestWire` adapter. Archived digests validate their length
and hexadecimal characters through `Digest<BYTES>` and normalize to
lowercase on deserialization.

The cache bumps cover the source-distribution, wheel, simple-index, and
flat-index buckets that contain these hashes. Lockfile and index hash
formats are unchanged.
Reapplies #22061 for 0.13.

We derive `Serialize` for `Revision` and `Archive`, writing MessagePack
arrays instead of maps. This removes the custom serializers and saves 15
bytes per source revision and 32 bytes per wheel archive record.

The `sdists-v10` and `wheels-v7` bumps remove the need to support older
readers that cannot accept the added `size` field.
Reapplies #22062 for 0.13.

We use `WheelFilename::cache_key()` for Windows wheel download,
extraction, and metadata locks, limiting lock filenames to 69
characters, including `.lock`. This covers both PEP 658 metadata
requests and the range-request fallback.

The `wheels-v7` and `sdists-v10` bumps remove the need to share lock
filenames with older uv versions.
Reapplies #22078 for 0.13.

We store the same HTTP cache information in fewer bytes, without
changing cache freshness or revalidation behavior.

- **Booleans become bits.** Ten fields like `no_cache`, `no_store`, and
`immutable` each occupied a byte. We pack them into bits of one integer.
- **Optional numbers share their presence flags.** Each archived
`Option<u64>` occupies 16 bytes: the number, an indicator of whether it
exists, and alignment padding. We store the numbers together and use one
bit per number to indicate whether it exists.

For example, `max_age = None` and `max_age = Some(0)` both store the
number `0`, but their presence bits differ. Getters reconstruct the
normal `Option<u64>`.

We apply this to cache-control directives and response timestamps. The
fixed archived policy shrinks from **320 to 200 bytes**. We use
`bitflags` for typed flag operations and retain endian-aware integers in
the archived representation.

The cache bucket bumps cover the new representation.
Reapplies #22079 for 0.13.

We align HTTP cache policies within the payload buffer and access them
directly after validation, removing a separate allocation and copy from
every cache read. Extracting the payload reuses the same allocation.

The file adds up to 15 bytes of padding, covered by the CRC32. Policy
validation is restricted to its own slice, and refreshes retain the
entry ID check before overwriting the policy.
Editable `-e` requirements in constraints files included with `-c` are
silently discarded. Reject these requirements with an error that
identifies the constraints file.

See [pip's constraints
documentation](https://pip.pypa.io/en/stable/user_guide/#constraints-files)
and [pip's editable-constraint
rejection](https://github.com/pypa/pip/blob/main/src/pip/_internal/req/req_install.py#L824-L832).

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
Quoted constraint, override, and exclude paths are split on spaces and
fail on the path prefix. Keep explicit CLI paths intact and only split
environment-provided lists. This fixes
[uv#12639](#12639) and removes the
undocumented behavior of supplying several CLI paths in one
space-delimited value
([uv#3162](#3162),
[uv#4124](#4124)).

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
A `--require-hashes` directive inside a constraints file included by a
requirements file is silently discarded, allowing packages without
hashes to install. Propagate hash enforcement from included constraints
into the parent requirements. Installs that previously ignored this
directive now fail when a requirement is missing a hash.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
Document the planned switch to Python 3.15 as the default stable
interpreter in the `0.13.0` changelog. Explain when uv downloads the new
version and how existing interpreters and explicit version pins affect
selection.
@zanieb
zanieb marked this pull request as ready for review October 9, 2026 17:37
@zanieb
zanieb merged commit f1d518d into main Oct 9, 2026
125 checks passed
@zanieb
zanieb deleted the release/0.13.0 branch October 9, 2026 17:37
zanieb added a commit that referenced this pull request Oct 9, 2026
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes #20791. Targets `release/0.13.0` for #22092.
zanieb pushed a commit that referenced this pull request Oct 9, 2026
## Summary

A source build can change its dependencies with `--config-settings`, but
uv looks up cached metadata before applying those settings to the cache
key. A later `uv pip compile` can therefore resolve the dependencies
from an earlier build. `uv pip install` can even exit successfully with
the wrong dependencies and leave an environment that fails `uv pip
check`. Concurrent commands expose this readily, but two sequential
commands sharing a cache also reproduce it.

Resolve dynamic metadata under the same build settings shard used for
the wheel, across registry, URL, path, directory, and Git sources. This
also accounts for extra build dependencies and variables already
included in the wheel key.

This relies on the source-distribution cache bump already included in
the 0.13 stack (#22092). It retains `sdists-v10` and `metadata.msgpack`;
there is no additional bucket or filename bump. This should land before
0.13.0 is released so the corrected layout ships with the new bucket.
astral-automations-bot Bot pushed a commit to astral-sh/uv-dev that referenced this pull request Oct 10, 2026
## Summary

New virtual environments on Python 3.10 and later omit `_virtualenv.py`
and `_virtualenv.pth` by default. Python 3.9 and earlier retain the
distutils configuration patch. Existing environments are left alone
until recreated.

Remove the preview gate, feature declaration, and unused `uv-virtualenv`
preview dependency, and add the 0.13 migration note. The existing
unknown-feature handling allows old `--preview-features
no-distutils-patch` invocations to continue with a warning. Cover the
3.9/3.10 boundary, seeded environments, the removed feature name, and
recreation of existing environments.

Fixes astral-sh#20791. Targets `release/0.13.0` for astral-sh#22092.

This branch was previously deployed

1 inactive deployment
automations — b225c74d Deployed Oct 9, 2026 by zanieb via review / security review #50359
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

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址