uv 0.12.0 Enhances Python Dependency Management with Stricter Hash Checking and Project Discovery
uv 0.12.0 introduces several changes to improve correctness, safety, and compatibility for Python dependency management, some of which are breaking for specific workflows. Key updates include stricter enforcement of hash-checking directives in `requirements.txt` and rejection of MD5-only hashes for verification. The release also stabilizes preview features like script-relative project discovery and safe virtual environment clearing, while deprecating the old `if-necessary-or-explicit` pre-release mode. These changes primarily affect developers using `uv` for package installation and environment management, requiring updates to `uv_build` bounds or hash configurations for certain setups.
- →Define build systems by default with uv init
- →Reject unsupported source distribution and wheel archive formats
- →Reject wheel files that could replace the Python interpreter (#20748, #20749)
- →Prefer stable releases before falling back to pre-releases
- →Respect --require-hashes directives in requirements.txt
Breaking changes (25) ›
- Define build systems by default with uv init
- Reject unsupported source distribution and wheel archive formats
- Reject wheel files that could replace the Python interpreter (#20748, #20749)
- Prefer stable releases before falling back to pre-releases
- Respect --require-hashes directives in requirements.txt
- Reject MD5-only hashes in hash-checking mode
- Reject invalid pylock.toml files and artifacts (#20402, #20440, #20443)
The packages array must be present. Previously, uv interpreted a missing array as an empty lockfile, so uv pip sync could uninstall an environment instead of rejecting malformed input. An explicitly empty packages = [] array remains valid
Lockfile filenames must be pylock.toml or a single-name variant such as pylock.dev.toml. Names such as pylock..toml and pylock.foo.bar.toml are rejected
If a wheel, source distribution, or other artifact declares a size, the downloaded or cached artifact must match. Previously, an incorrect size was accepted when the hash was correct. Sizes reported by package indexes remain advisory
- Honor explicit certificate overrides even when no certificates can be loaded (#20741, #20767)
- Support pip-compatible --cert handling in uv pip
- Discover projects relative to the script passed to uv run
- Require --force before clearing a directory that is not a virtual environment
- Reject --project when initializing a project
- Reject missing or invalid --project paths
- Skip distributions with non-normalized filenames when publishing
- Classify Conda environments named base and root by their paths
- Reject broken .venv symlinks during environment discovery
- Reinstall matching installed Python patch versions instead of upgrading implicitly
- Require --upgrade-group to name an existing dependency group
- Resolve relative indexes and find-links against --directory
- Preserve absolute paths provided to uv add
- Remove older PyPy distributions that are only available as bzip2 archives
- Omit excluded-package comments when annotations are disabled
Features (1) ›
- Allow uv upgrade to target multiple packages, upgrade all production dependencies, and exclude selected dependencies
Fixes (1) ›
- Include extras activated by dependency groups when evaluating conflicts
https://github.com/astral-sh/uv/releases/tag/0.12.0
Related releases
- Pydantic-AI v2.43.0 Enhances CLI Experience and Fixes OpenAI Chat Model Behavior Pydantic AI Releases ·
- ADK-Python v2.9.0 enhances agent resilience, voice integration, and workflow management Google ADK (Python) Releases ·
- uv 0.12.13 Released: Adds GraalPy 3.13.0 Support and Security Enhancements uv Releases ·
- PyCharm License Discount for Django Software Foundation Extended Django Weblog ·
- CrewAI 1.15.21 Release Introduces Telemetry and Resolves Multiple Bugs CrewAI Releases ·
- uv 0.12.12 Adds Code Signing for macOS/Windows Binaries and Fixes Exclude-Newer Bug uv Releases ·