Pulumi + uv: Fast Python Package and Project Management

Posted on

Continuing our work to bring the best of modern Python to Infrastructure as Code, we are excited to announce built-in support for uv in Pulumi. uv is an extremely fast Python package manager that can install dependencies up to 100x faster than traditional tools, providing one of the fastest ways to manage your Python dependencies and virtual environments.

Why uv?

Listen in on this discussion between Adam Gordon Bell and Julien Poissonnier as they discuss Pulumi + uv and why uv is so fast!

uv brings several key advantages to your Python development workflow:

  • Blazing Fast Performance: Written in Rust, uv can install packages 10-100x faster than pip
  • Reliable Dependency Resolution: Advanced resolution algorithm ensures consistent environments
  • Drop-in Replacement: Works seamlessly with existing requirements.txt and pyproject.toml files
  • Built-in Virtual Environment Management: Simplified environment handling out of the box

Using uv in Pulumi

To use uv to manage your Python virtual environment and dependencies, set the toolchain option to uv in your Pulumi.yaml file:

name: uv-goes-brrrr
runtime:
  name: python
  options:
    toolchain: uv
    virtualenv: .venv

If you have uv installed, you can run pulumi new python and select uv as the toolchain to use for installing dependencies and running the program.

You can find more information on how to use uv in Pulumi in our Python documentation.