Skip to content

Release 0.12.0 - #20355

Merged
zanieb merged 22 commits into
mainfrom
release/0.12.0
Jul 28, 2026
Merged

zanieb merged 22 commits into
mainfrom
release/0.12.0

Conversation

@astral-sh-bot

astral-sh-bot Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

uv test inventory changes

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

  • Added tests: 78
  • Removed tests: 38
  • Changed suites: 14
uv-client: +2 / -0

Added:

  • uv-client::tls::tests::test_from_env_empty_ssl_cert_dir_returns_empty_roots
  • uv-client::tls::tests::test_from_env_missing_ssl_cert_file_returns_empty_roots

Removed: none

uv-client::it: +4 / -2

Added:

  • uv-client::it::ssl_certs::test_cli_cert_overrides_environment
  • uv-client::it::ssl_certs::test_cli_cert_valid
  • uv-client::it::ssl_certs::test_ssl_cert_dir_nonexistent_overrides_default_roots
  • uv-client::it::ssl_certs::test_ssl_cert_file_nonexistent_overrides_default_roots

Removed:

  • uv-client::it::ssl_certs::test_ssl_cert_dir_nonexistent_falls_back
  • uv-client::it::ssl_certs::test_ssl_cert_file_nonexistent_falls_back
uv-distribution: +1 / -0

Added:

  • uv-distribution::archive::tests::deserialize_legacy_archive

Removed: none

uv-toml: +0 / -24

Added: none

Removed:

  • uv-toml::tests::escapes_double_backslash_e
  • uv-toml::tests::escapes_double_backslash_x
  • uv-toml::tests::escapes_plain_string
  • uv-toml::tests::escapes_toml10_escape_n
  • uv-toml::tests::escapes_toml10_escape_u
  • uv-toml::tests::escapes_toml11_esc
  • uv-toml::tests::escapes_toml11_hex
  • uv-toml::tests::features_array_of_tables
  • uv-toml::tests::features_double_backslash_not_escape
  • uv-toml::tests::features_esc_escape
  • uv-toml::tests::features_escape_in_nested_structure
  • uv-toml::tests::features_hex_escape
  • uv-toml::tests::features_hex_escape_in_dotted_quoted_key
  • uv-toml::tests::features_hex_escape_in_quoted_key
  • uv-toml::tests::features_inline_table_no_trailing_comma
  • uv-toml::tests::features_multiline_inline_table
  • uv-toml::tests::features_multiline_inline_table_with_trailing_comma
  • uv-toml::tests::features_optional_second_time_values
  • uv-toml::tests::features_plain_toml10
  • uv-toml::tests::features_std_table
  • uv-toml::tests::features_toml10_escape_in_value
  • uv-toml::tests::features_toml10_time_values_are_not_11
  • uv-toml::tests::features_trailing_comma_in_array_is_not_11
  • uv-toml::tests::features_trailing_comma_in_inline_table
uv::build: +2 / -1

Added:

  • uv::build::build::build_fast_path_verbose
  • uv::build::build_backend::rewrite_toml_1_1_by_default

Removed:

  • uv::build::build_backend::warn_on_toml_1_1_auto_detected
uv::it: +4 / -1

Added:

  • uv::it::help::cert_is_limited_to_pip
  • uv::it::network::invalid_ssl_cert_dir_warns_default_roots_are_disabled
  • uv::it::network::invalid_ssl_cert_file_warns_default_roots_are_disabled
  • uv::it::resource_limits::adjust_open_file_limit

Removed:

  • uv::it::publish::non_normalized_filename_warning
uv::lock: +4 / -0

Added:

  • uv::lock::lock::lock_explicit_prerelease_mode
  • uv::lock::lock::lock_upgrade_group_frozen
  • uv::lock::lock::lock_upgrade_group_legacy_dev_dependencies
  • uv::lock::lock::lock_upgrade_group_missing

Removed: none

uv::lock_scenarios: +7 / -0

Added:

  • uv::lock_scenarios::lock_conflict::group_activates_self_extra
  • uv::lock_scenarios::lock_conflict::group_activates_self_extra_non_project_workspace
  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_stable_preference_explicit_first
  • uv::lock_scenarios::lock_scenarios::prerelease_base_marker_stable_preference_plain_first
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_equivalent_stable_preference
  • uv::lock_scenarios::lock_scenarios::prerelease_marker_stable_preference_backtracks
  • uv::lock_scenarios::lock_scenarios::transitive_prerelease_forks

Removed: none

uv::pip: +29 / -1

Added:

  • uv::pip::pip_install_scenarios::package_stable_prerelease_candidates
  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_after_backtrack
  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_base_extra_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::prerelease_capped_union_alternate_parent
  • uv::pip::pip_install_scenarios::prerelease_capped_union_backtrack
  • uv::pip::pip_install_scenarios::prerelease_equivalent_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_equivalent_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::prerelease_extra_stable_preference
  • uv::pip::pip_install_scenarios::prerelease_extra_stable_preference_backtracks
  • uv::pip::pip_install_scenarios::prerelease_fallback_after_stable_rejected
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_stable_preference
  • uv::pip::pip_install_scenarios::prerelease_multiple_redundant_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::prerelease_redundant_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_after_decision
  • uv::pip::pip_install_scenarios::transitive_prerelease_backtracks
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_stable_preference_explicit_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_equivalent_stable_preference_plain_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_prefers_stable
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_stable_preference_parent_first
  • uv::pip::pip_install_scenarios::transitive_prerelease_redundant_stable_preference_plain_first
  • uv::pip::pip_sync::cert
  • uv::pip::pip_sync::pep_751_requires_packages
  • uv::pip::pip_sync::pep_751_validates_archive_size
  • uv::pip::pip_sync::pep_751_validates_cached_remote_archive_size
  • uv::pip::pip_sync::pep_751_validates_remote_archive_size
  • uv::pip::pip_sync::reject_sdist_archive_type_bz2
  • uv::pip::pip_sync::require_hashes_in_requirements_txt

Removed:

  • uv::pip::pip_sync::install_sdist_archive_type_bz2
uv::pip_compile: +5 / -0

Added:

  • uv::pip_compile::pip_compile::cert
  • uv::pip_compile::pip_compile::compile_lowest_prereleases
  • uv::pip_compile::pip_compile::inactive_scoped_override_does_not_enable_prerelease
  • uv::pip_compile::pip_compile::offline_registry_prerelease
  • uv::pip_compile::pip_compile::unsafe_package_no_annotate

Removed: none

uv::pip_install: +13 / -3

Added:

  • uv::pip_install::pip_install::build_transitive_prerelease
  • uv::pip_install::pip_install::disallow_transitive_prerelease
  • uv::pip_install::pip_install::explicit_prerelease_allows_direct_marker
  • uv::pip_install::pip_install::explicit_prerelease_disallows_transitive_marker
  • uv::pip_install::pip_install::explicit_prerelease_does_not_fall_back_if_necessary
  • uv::pip_install::pip_install::explicit_prerelease_prefers_stable_for_direct_marker
  • uv::pip_install::pip_install::fail_on_bz2_wheel
  • uv::pip_install::pip_install::fail_on_lzma_wheel
  • uv::pip_install::pip_install::if_necessary_or_explicit_is_deprecated_alias
  • uv::pip_install::pip_install::install_require_hashes_in_requirements_txt
  • uv::pip_install::pip_install::prerelease_index_strategy_ordering
  • uv::pip_install::pip_install::registry_wheel_size_is_advisory
  • uv::pip_install::pip_install::reject_case_variant_reserved_wheel_entrypoint_name

Removed:

  • uv::pip_install::pip_install::build_prerelease_hint
  • uv::pip_install::pip_install::warn_on_bz2_wheel
  • uv::pip_install::pip_install::warn_on_lzma_wheel
uv::project: +2 / -4

Added:

  • uv::project::edit::add_relative_and_absolute_archives
  • uv::project::init::init_project_flag_is_not_allowed

Removed:

  • uv::project::init::init_project_flag_is_ignored_with_explicit_path
  • uv::project::init::init_project_flag_is_not_allowed_under_preview
  • uv::project::init::init_project_flag_is_warned_without_path
  • uv::project::run::run_project_not_found_preview
uv::python: +1 / -2

Added:

  • uv::python::venv::non_empty_dir_exists_clear_force

Removed:

  • uv::python::venv::non_empty_dir_exists_clear_preview
  • uv::python::venv::non_empty_dir_exists_clear_preview_force
uv::sync: +4 / -0

Added:

  • uv::sync::show_settings::resolve_relative_indexes_with_directory
  • uv::sync::sync::sync_non_pep625_sdist
  • uv::sync::sync::sync_non_pep625_sdist_from_lockfile
  • uv::sync::sync::sync_non_pep625_sdist_with_compatible_wheel

Removed: none

@codspeed

codspeed Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 5.53%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 20 untouched benchmarks
⏩ 6 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation resolve_warm_jupyter_universal 121.6 ms 128.7 ms -5.53%

Tip

Investigate this regression with the CodSpeed MCP and your agent.


Comparing release/0.12.0 (6ff71ad) with main (b6359fe)

Open in CodSpeed

Footnotes

  1. 6 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 Jul 14, 2026
Revert #20402. Older uv versions could emit `pylock.toml` files without
the required `packages` array; #20145 only recently corrected that
emission. Rejecting those existing files in a non-breaking release would
make previously generated lockfiles unusable.

#20402 has been moved to #20355 as
ace867f

Co-authored-by: Zanie Blue <[email protected]>
@konstin konstin added this to the v0.12.0 milestone Jul 21, 2026
Comment thread crates/uv-requirements-txt/src/lib.rs Resolved
Comment thread crates/uv-requirements-txt/src/lib.rs Resolved
zanieb and others added 12 commits July 28, 2026 13:42
Prior to this change, we needed to know upfront whether a given package
was "allowed" to use a pre-release -- either by way of being a
first-party dependency with a pre-release marker on it (e.g., `flask >=
2.0.0a0`), or by _only_ having pre-releases available on PyPI at all, or
by the user _always_ allowing pre-releases via configuration. By
default, if transitive metadata later introduced a requirement like
`foo>=2.0.0b1`, that requirement did _not_ enable pre-releases for
`foo`, even though it should've (per the spec).

This PR adds support for actual transitive pre-release requirements: we
prefer stable candidates that satisfy the current range, then consider
pre-releases when those candidates are exhausted. An explicit
pre-release requirement discovered during resolution is represented by a
PubGrub proxy package.

For completeness, I also prototyped a
[nab](https://github.com/notatallshaw/nab)-style solution in #19998.
That design encoded stable- and pre-release-enabled variants directly in
PubGrub. It's arguably semantically nicer, but it was much more invasive
and caused more significant CodSpeed regressions on large graphs. I
ultimately decided that this solution is better for now, given that it's
both simpler and closer to how we model versions today.

This smaller, proxy-package solution does get at least one case wrong.
If a selected stable version of package A satisfies requirements, and we
then find a package that depends on A with a pre-release, PubGrub may
retain that version instead of "upgrading" it to a newer pre-release.
The net effect is that we may accept an older stable release rather than
upgrading to a newer pre-release if we see a pre-release requirement
later on in a solve. I think this is an acceptable limitation as
compared to the number of issues we'll be able to close here. And nab
suffers from some similar issues (as per
#19993 (comment)).

Finally, the former `--prerelease=explicit` policy has been deprecated.
`explicit` is the only mode we can't support here, because it requires
adding pre-release candidates after resolution has already begun. The
behavior is preserved, but unlike the other modes, it doesn't support
transitive pre-releases (i.e., it's ~unchanged vs. main). Personally, I
don't think that `explicit` vs. `if-necessary-or-explicit` is really an
important distinction.

Related: #3602.
Related: #14851.

Closes #19593.
Closes #2685.
Closes #11483.
Closes #19324.
Closes #12589.
Closes #9395.
Closes #16494.
Closes #16893.
## Summary

Right now, we log a warning but proceed, which means we're effectively
ignoring the `--require-hashes` directive (if you're not careful to
watch for warnings).

This can be considered breaking because workflows that previously passed
may now fail.

Co-authored-by: Codex <[email protected]>
The target must match to an existent group.

Closes #18939.
## Summary

- suppress the excluded-package footer when `uv pip compile
--no-annotate` is used
- keep the existing footer behavior when annotations are enabled
- add coverage for `--unsafe-package` combined with `--no-annotate`

Closes #19948.

Co-authored-by: wzp <[email protected]>
## Summary

Follow-up to #18176. This fixes the remaining absolute/relative path
issues when `uv add` edits `pyproject.toml`.

`uv add` now preserves the user's path form:

- Relative paths remain relative.
- Absolute paths and literal `file://` URLs remain absolute.
- URLs containing expanded variables remain relative, preserving the
portability behavior from #18680 for both named and unnamed
requirements.

This applies to local directories and local archives.

* Closes #17307
* Closes #17316

## Test Plan

- Integration coverage for relative paths, absolute paths, and literal
`file://` URLs.
- Integration coverage for directory and archive sources.
- Regression coverage for expanded-variable URLs.
- `cargo nextest run -E 'test(add_relative_and_absolute_paths) or
test(add_relative_and_absolute_archives) or
test(lock_pep508_urls_with_vars)'`
- `cargo nextest run -p uv-pep508 -p uv-pypi-types`
- `cargo clippy --workspace --all-targets --all-features --locked -- -D
warnings`
- `cargo xwin clippy --workspace --all-targets --all-features --locked
-- -D warnings`
## Summary

> Note: Not sure if this is bug or enhancement. Someone help.

While perusing the code I noticed this confusing TODO about `uv python
install --reinstall`.

In #11072 we changed `uv python install --reinstall` to reinstall all
existing Python installations except when a specific minor version was
passed, in which case we would instead install the latest available
patch. This was justified due to having no `--upgrade` at the time.

Then in #16676 we introduced `uv python install --upgrade` but we didn't
change the `--reinstall` behaviour. So we now had two ways to do this
one thing, but no way to re-install only specific versions.

This PR completes the deferred change to `--reinstall`. That's the first
commit. The second commit restores the behaviour of `--reinstall
--upgrade`, which install or reinstalls the latest patch only, not sure
if this is a desirable combo, but it _did_ work in the past and I didn't
know if it should break too. Without the special case `--reinstall`
takes precedence and `--upgrade` is ignored.

This change seems breaking. It's currently just dropped right in (maybe
0.12.0?) but I'm also open to putting it behind a preview flag and
adding some warnings.

## Test Plan

Test adjustments, to match/test the new behaviours.
## Summary

~~WIP.~~

This removes the bzip2/lzma/xz features from our backing ZIP
dependencies, per our long term plans to not support these compression
schemes (as they're not standard parts of Python packaging). ~~This
doesn't remove the similar paths from tarball handling, yet.~~

This is a breaking change, so it probably shouldn't be merged until
we're ready to cut 0.12.

See #16911 for context.

## Test Plan

Will update the snapshot tests.

---------

Signed-off-by: William Woodruff <[email protected]>
## Summary

Add pip-compatible `--cert <path>` support to all `uv pip` commands. The
option is scoped to the `uv pip` namespace, so other uv commands
continue to reject it.

An explicit certificate bundle replaces uv's default, system, and
`SSL_CERT_FILE` / `SSL_CERT_DIR` trust sources for that invocation,
matching pip's behavior without modifying the environment inherited by
child processes.

Preserve newer release-branch TLS alert regression tests and update the
restored certificate snapshots to the current output format.
A pylock.toml missing the required packages array is treated as an empty lock, so sync can uninstall an environment instead of rejecting malformed input. Require the array during deserialization while continuing to accept an explicitly empty array.

See [the pylock.toml packages specification](https://packaging.python.org/en/latest/specifications/pylock-toml/#packages).
A `pylock.toml` artifact can declare an incorrect `size` and still
install when its hash is correct, despite the [`pylock.toml`
installation
specification](https://packaging.python.org/en/latest/specifications/pylock-toml/#installation)
requiring size checks when present. Validate declared sizes for local,
remote, and cached wheels, source distributions, and archives before
installation, while continuing to treat registry-reported sizes as
advisory.

This is breaking for locks with stale sizes that were accepted by
installers such as [pip, which currently leaves file-size validation
unimplemented](https://github.com/pypa/pip/blob/main/src/pip/_internal/req/constructors.py#L590-L605).
Regenerate the lock or remove the stale optional `size`; pre-existing
cache entries without recorded sizes will refresh.
konstin and others added 3 commits July 28, 2026 13:53
Closes #20185.

Stabilize the eight preview features planned for uv 0.12, making their
preview behavior the default and removing the transitional warnings and
code paths:

- `adjust-ulimit`: raise the open-file limit on Linux and macOS at
startup.
- `init-project-flag`: reject `uv init --project` instead of warning.
- `project-directory-must-exist`: reject missing or non-directory
`--project` paths immediately.
- `publish-require-normalized`: skip wheels and source distributions
with non-normalized filenames.
- `special-conda-env-names`: use path-based detection for Conda
environments named `base` or `root`.
- `target-workspace-discovery`: discover the project or workspace from a
target script's directory instead of the current working directory.
- `toml-backwards-compatibility`: always rewrite the source-distribution
`pyproject.toml` to TOML 1.0-compatible syntax and preserve the original
as `pyproject.toml.orig`, removing the now-unneeded TOML 1.1 detector
and dependencies.
- `venv-safe-clear`: reject `uv venv --clear` on a
non-virtual-environment directory unless `--force` is provided.

Update the corresponding snapshots and remove redundant preview-only
tests and branches.

---------

Co-authored-by: konsti <[email protected]>
Prepare the changes when stabilizing package by default, as a preview
how this looks after stabilization.

I've updated the snapshots of other `uv init`-using test to using
packaged projects (separate commit), they don't seem to be testing
unpacked cases specifically and using the defaults seems the most
realistic choice for them.

To be merged with the next breaking release.
…ry` if provided (#20740)

## Summary

The `--directory` argument is documented to change the directory
relative to which uv operates. It would therefore be expected that
options and arguments with relative paths passed to uv would resolve
relative to the target specified by `--directory` but this was not the
case for various index arguments.

This PR addresses this.

For example:

```
$ uv add --directory foo --index ./bar ...
```

Would previously look for the index in `./bar` but with this PR would
look for it in `./foo/bar`.

I think this is actually a breaking change.

> Note: I strongly recommend reviewing the commits separately. There is
preparatory work which is mechanical and easier to review separately.

## Test Plan

There's a show settings test which targets testing this regression.
Application and packaged application trade places, and we have to
de-emphasize packaged layouts as special.

This PR needs to be merged just before the release that stabilizes
package by default.

---------

Co-authored-by: Zsolt Dollenstein <[email protected]>
Co-authored-by: Zanie Blue <[email protected]>
`uv build` currently appends `(uv build backend)` to each progress line
when it uses the bundled backend, exposing an implementation detail and
repeating it for source distributions and wheels. Log backend selection
once at debug level instead, keeping ordinary build progress consistent
across direct and PEP 517 builds.

Co-authored-by: Zanie Blue <[email protected]>
When `SSL_CERT_FILE` or `SSL_CERT_DIR` points to a missing path or
contains no valid certificates, uv currently falls back to its default
trust roots despite the explicit certificate-source override. Treat
every nonempty configured certificate source as authoritative, retaining
an empty trust store when no certificates can be loaded and preserving
the existing behavior for empty environment-variable values. Fixes
#18526.

---------

Co-authored-by: Zanie Blue <[email protected]>
zanieb added 2 commits July 28, 2026 12:05
Invalid names such as `pylock..toml` and `pylock.foo.bar.toml` are
accepted even though the [`pylock.toml` filename
specification](https://packaging.python.org/en/latest/specifications/pylock-toml/#file-name)
permits only `pylock.toml` and single-name variants such as
`pylock.dev.toml`. Validate the complete filename.

This is breaking for existing dotted lock names, including files
discovered by [Pipenv's `pylock.*.toml`
glob](https://github.com/pypa/pipenv/blob/main/pipenv/utils/pylock.py#L746-L768);
those files must be renamed.
Running a pip command beneath a broken child `.venv` symlink can skip
that environment and modify an unrelated ancestor environment. Stop
discovery at the broken link and report its exact path, preserving the
actionable broken-link diagnostic introduced in
[#12168](#12168).

[#20333](#20333) separately allows
interpreter-only commands to fall back when `.venv` is a non-venv
directory; this keeps pip from taking that fallback across a broken
child link.
zaniebot and others added 2 commits July 28, 2026 12:11
With package-by-default enabled, `uv init --app` still implicitly
selected the unpackaged application layout, so explicitly requesting an
application produced a different project than `uv init`.

Apply the packaged default to explicitly requested applications as well,
while retaining `--no-package` for applications that should remain
unpackaged.

---------

Co-authored-by: Zanie Blue <[email protected]>
#20418 moved certificate overrides out of `BaseClientBuilder` and
applied them to the main HTTP client. The separate client used by `uv
run https://...` and GitHub Gists was left unconfigured, allowing remote
scripts to fall back to the default trust store instead of respecting
`SSL_CERT_FILE` and `SSL_CERT_DIR`.

Apply the environment certificate overrides directly to the
remote-script client before downloading. Preserve the default trust
store when neither override is set, but fail closed when an explicitly
configured certificate source is missing or invalid.

Follow-up to the [discussion on
#20418](#20418 (comment)).
@zanieb
zanieb marked this pull request as ready for review July 28, 2026 17:29
@zanieb
zanieb merged commit b187a51 into main Jul 28, 2026
114 of 115 checks passed
@zanieb
zanieb deleted the release/0.12.0 branch July 28, 2026 17:30

This branch was previously deployed

1 inactive deployment
automations — 692d4db2 Deployed Jul 28, 2026 by zanieb via review / security review #43595
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.

8 participants