pydevtools.com blog
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:
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.”
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.
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.
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.
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.
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.
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.'
February 16, 2024
Pip and Poetry and Hatch, Oh My!
Modern Python developers have a plethora of tooling available to help the development process. When I started with Python in 2011, packaging was done with setuptools (or its predecessor distutils), and virtual environments were created with the virtualenv library. Now developers can (have to?) choose between a breadth of packaging tools (e.g., setuptools, Flit, Poetry, PDM, Hatch). Some of these tools manage virtual environments while others require the developer to do this themself. Every developer managing virtual environments has had to figure out the difference between venv and virtualenv–not to mention wondering how they differ from Conda environments.
February 14, 2024
Sponsor the Python Developer Tooling Handbook!
I’d like to release the first edition of the Python Developer Tooling Handbook in 2024. This project is a labor of love from me to the Python community. If you’ve ever struggled with Python packaging or dependency management, please consider sponsoring the project on Github.
February 14, 2024