UV: Stop Suffering with Python Dependencies

UV: Stop Suffering with Python Dependencies

3 min de leitura

If you still use pip + venv + pip-tools (or Poetry) and feel your Python workflow has become too heavy, it is time to look at uv.

uv is a tool from Astral (the same company behind Ruff) for:

  • managing dependencies
  • creating and syncing virtual environments
  • pinning versions with a lockfile
  • running scripts and commands in isolation
  • managing Python projects with a modern developer experience

The promise is straightforward: be dramatically faster without sacrificing reproducibility.

Why has uv gained so much attention?

Most pain in the Python ecosystem comes from one recurring problem: slow, confusing, and inconsistent dependency management across machines.

uv addresses this with a few core pillars:

  • Very high performance (resolving and installing packages in seconds)
  • Unified workflow: one tool for project, environment, and lock
  • Compatibility with the existing Python ecosystem
  • Direct UX with predictable commands

In other words: less time waiting for installs, more time writing code.

Speed comparison (official data)

According to uv’s official documentation, the tool can be 10-100x faster than pip in compatible workflows:

In examples from the official landing page, timings appear in milliseconds for common project operations like resolve and sync:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$ uv add ruff
Resolved 2 packages in 170ms
Prepared 2 packages in 627ms
Installed 2 packages in 1ms

$ uv lock
Resolved 2 packages in 0.33ms

$ uv sync
Resolved 2 packages in 0.70ms
Checked 1 package in 0.02ms

Source: https://docs.astral.sh/uv/#projects

For detailed benchmarks (warm/cold install and warm/cold resolution), the uv team publishes methodology, caveats, and comparisons against other tools here:

Important: results vary based on OS, filesystem, and dependency set.

UV Projects in practice

The Projects section in the official docs shows the full workflow:

https://docs.astral.sh/uv/#projects

With uv, you can start a project and keep everything consistent from the very first commit.

1. Create a project

1
2
uv init my-project
cd my-project

This creates the base Python project structure and metadata.

2. Add dependencies

1
2
uv add pandas
uv add --dev pytest ruff

No command juggling: runtime and development dependencies stay organized in the project.

3. Generate/sync the environment

1
uv sync

uv creates or updates the environment so it exactly matches your declared state.

4. Run commands in the project environment

1
2
uv run python -m my_project
uv run pytest

You do not need to manually switch environments all the time.

Lockfile and reproducibility

One of uv’s biggest gains is the lockfile, which pins versions for consistent execution across:

  • your local machine
  • CI environments
  • production

This reduces the classic “it works on my machine” problem.

In practice, the whole team installs the same versions with fewer deployment surprises.

UV vs Pip: what changes day to day?

Compared to a traditional workflow:

  • pip: installs packages, but does not manage the full project lifecycle
  • uv: unifies dependencies + environment + execution + lockfile in one workflow

Result:

  • faster initial setup
  • easier onboarding for new developers
  • fewer helper scripts to keep environments in order

When is migration worth it?

Moving to uv is usually worth it when you want to:

  • reduce project setup time
  • standardize environments across a team
  • simplify CI pipelines
  • reduce the number of tools in your stack

If you are starting a new project, it is even easier: start with uv on day one.

Conclusion

uv is not just “a faster pip”. It points to a more modern Python workflow: less operational friction, more predictability, and more speed.

If you want real productivity gains in your development cycle, it is worth trying in your next project.