pydevtools.com blog

Why Use uv Projects Instead of requirements.txt?

ℹ️ This is an excerpt from the forthcoming Python Developer’s Tool Handbook. The handbook provides comprehensive guidance on Python tooling and best practices for modern Python development. The Python ecosystem offers two main approaches to managing project dependencies: the traditional requirements.txt file and the newer pyproject.toml standard. Understanding the strengths and limitations of each helps inform better choices for Python development.

Read more →

February 19, 2025

bitecode.dev's "A year of uv"

The game-changing tool uv was released a year ago, and the results are compelling. A detailed analysis from bitecode.dev provides an in-depth look at uv’s real-world performance across diverse Python environments and use cases. Some uv highlights noted in the article: uv solves Python bootstrapping issues elegantly through Python-independent installation and unified cross-platform behavior Performance advantages are dramatic - tasks that took minutes now take seconds Dependency resolution is more reliable than alternatives Integration with existing tools and workflows is seamless Error messages are clear and actionable The article lists 5 situations where uv might not be appropriate, but I found these caveats overly cautious. The core benefits of uv - speed, reliability, and simplified workflows - are compelling enough that any team able to use uv should strongly consider adoption.

Read more →

February 18, 2025

Flexible Python Version Management with uv and tox

When working with Python projects that use tox for testing, you may encounter version mismatch errors like: lint-format: skipped because could not find python interpreter with spec(s): python3.8 This happens when tox expects a specific Python version that isn’t available in your environment. Traditionally, this would require:

Read more →

February 12, 2025

It's happening! A Python Type Checker from Astral

After months of speculation, Astral (creators of Ruff and uv) has officially announced their work on a new static type checker for Python. Built from the ground up in Rust, this tool aims to bring Astral’s signature focus on performance to Python’s static typing ecosystem. Charlie Marsh, Astral founder, says that beyond performance, the project seeks to minimize “false positives, especially on untyped code, to make it easier for projects to adopt a type checker and expand coverage gradually over time, without being swamped in bogus type errors from the start.”

Read more →

January 29, 2025

One Line Command to Launch a Notebook with Pytorch

uv is changing how accessible Python is for new users. If you want to try out pytorch in a Jupyter Notebook, you can install uv and then run this single line command: uv run --python 3.12 --with "torch~=2.4" --with jupyter --with "numpy<2" jupyter lab uv will grab all your dependencies (including Python 3.12, if you don’t have it installed), install them in an isolated environment, and launch Jupyter Lab.

Read more →

January 15, 2025

"uv: Towards a unified vision for Python tooling"

This is a great post by Prashanth Rao on the unified vision that uv brings for Python package and project management. As he shares, the tools in this space have been improving over the last 15 years, but uv is a step-change for usability. The most remarkable aspect of uv is the list of steps he shares that (might) happen when you call uv run hello.py: Installs Python if it’s not already installed Creates and activates the virtual environment Installs the dependencies Runs the code And all of this happens with blazing speed.

Read more →

December 27, 2024

Effective Python Developer Tooling in December 2024

I have been writing Python for 14 years next month. When I started, people were still using easy_install to install egg-based packages for Python 2.7 and nobody had heard about Conda yet, much less uv. Needless to say, the Python tool ecosystem has changed and developed since. Many people are rightfully confused by the fragmentation in the ecosystem; at the same time, we unequivocally have better tooling for Python today than we’ve ever had before.

Read more →

December 20, 2024

uv 0.3: One command line to rule them all (almost)

Yesterday, Charlie Marsh and his team at Astral released uv 0.3.0. For those who may have missed it, uv was released earlier this year primarily as a blazing-fast replacement for pip for installing Python packages. This new release provides new documentation and a host of new functionality. Charlie Marsh and Simon Willison have written helpful posts about the new functionality. I thought it’d be helpful to illustrate how the current uv functionality compares to existing tools: uv Command Alternative to uv pip pip and pip-tools uv venv venv and virtualenv uv tool pipx uv init Poetry/PDM (partially) uv python pyenv uv run nothing! uv only partially replicates Poetry and PDM because it has yet to implement package building and publishing, only project management. However, they provide simple commands for publishing using existing tools and a uv project.

Read more →

August 21, 2024

Require pip to install packages in virtual environment

A frequently heard piece of advice in improving Python development practice is using virtual environments to install dependencies. Virtual environments isolate your dependencies per project to protect you from annoying version conflicts. You can restrict pip to only install in virtual environments by running pip config set global.require-virtualenv true This updates your global pip config file.

Read more →

March 4, 2024

uv got to keep up: a new installer announced!

Astral, Charlie Marsh's company best known for Ruff, announced uv today, 'an extremely fast Python package installer and resolver, written in Rust.'

Read more →

February 16, 2024