Skip to the solution
EasyBackend13 min read

What is uv and why is it replacing pip/poetry in 2025-26?

712 views

The problem

Question presented to candidate: "A lot of teams moved their Python projects to uv over the last two years. What is uv, what does it replace, and why are people switching from pip, pip-tools and Poetry? Are there reasons not to?"

What a strong answer should cover:

  • uv is a single Rust binary from Astral that covers installing packages (uv pip), creating venvs, locking and syncing projects (uv add, uv lock, uv sync, uv run), running tools (uvx), running single-file scripts with inline metadata (PEP 723) and installing Python itself (uv python install)
  • Speed comes from a Rust resolver, parallel downloads and a global cache that installs by cloning or hard-linking files into each venv; warm-cache operations take milliseconds
  • Projects are standards-based: [project] in pyproject.toml, PEP 735 [dependency-groups], and a cross-platform uv.lock committed to git; uv run keeps the venv in sync automatically
  • Compared with pip: pip installs into an environment but has no project lockfile workflow (an experimental pip lock arrived in pip 25.1); compared with Poetry: similar workflow, but uv also manages Python versions and tools, and is much faster
  • Trade-offs and context: uv.lock is uv-specific (it can export requirements.txt or PEP 751 pylock.toml), pip remains the default installer that ships with Python, and the company behind uv is being acquired by OpenAI (announced March 2026), with a stated commitment to keep it open source

Clarifying questions expected:

  • Is this an application (lockfile matters) or a library published to PyPI (ranges matter)?
  • What does the team use today, and does CI or deployment depend on requirements.txt?

Code / implementation expected: Optional โ€” the basic uv init / uv add / uv run workflow, or a PEP 723 script header.

  • uv
  • packaging
  • python3.11

Try it yourself

Sketch your approach before you read the solution. That is what the interview tests.

Stuck? Get a hint.

A short nudge toward the approach. It will not give the answer away.

Solution

The solution is hidden so you can try first

13 min read ยท 12 sections

Run the code

Edit the code and run it here. Each console line with an expected value becomes a test.

PythonInline script metadata (PEP 723) and the pyproject tables uv reads
PythonWhat a real uv.lock records, and a toy freshness check

Discussion

Other approaches, follow-ups and how it went in real interviews.

Sign in to join the discussion.

No comments yet. Share how you would answer it.

Question 16 of 139 in Python

Keep your momentum going.

Mark this question solved to track your progress, then take the next one while it is fresh.

All Python questions
Up nextEasy

Is Python pass-by-value or pass-by-reference?

Continue