uv: Streamlining Python Script Dependency Management

2025-07-22

uv is a powerful tool that simplifies dependency management for Python scripts. It eliminates the need for manual environment management, automatically handling virtual environments and preferring a declarative approach to dependencies. Whether your script relies on standard library modules or external packages like `rich`, uv makes execution straightforward with the `uv run` command, specifying dependencies via the `--with` option. uv also supports inline script metadata, allowing dependency and Python version declarations directly within the script. Further enhancing reproducibility, uv offers dependency locking and handles various scenarios, including reading scripts from stdin, supporting .pyw extensions, and specifying alternative package indices.

Read more
Development virtual environments

uv Build Backend: Faster and Smoother Python Builds

2025-07-03

uv's native build backend, uv_build, significantly improves the speed and user experience of building Python projects. It features sensible defaults, aiming for zero configuration for most users, while offering flexible configuration to accommodate diverse project structures. uv_build currently supports pure Python code; alternative backends are needed for libraries with extension modules. Use this backend by adding `uv_build` to your `pyproject.toml` or by creating a new project with `uv init --build-backend uv`. uv_build also optimizes package name normalization, module discovery, and file inclusion/exclusion strategies, leading to more predictable and repeatable builds.

Read more
Development

uv: A Blazing-Fast Python Package and Project Manager

2024-12-14

uv, a lightning-fast Python package and project manager written in Rust, replaces pip, pip-tools, pipx, poetry, pyenv, twine, and virtualenv. Boasting a 10-100x speed improvement, uv offers project management, tool management, Python version management, script support, and a pip-compatible interface. Features like global caching and workspace support streamline workflows. From project creation and dependency management to running scripts and building distributables, uv provides efficient and convenient solutions for all your Python development needs.

Read more