Dependency and Environment Management in Python

People have a lot of opinions about dependency and environment management in Python.

Python's been having a moment recently, as more tools are coming out to address problems people have had with pip and virtualenv.

I'm not going to add my own two cents. This is more of a survey of what I've found and read.

Here's a two-part analysis from early 2019 of Pipenv and Poetry, looking at speed and user experience (in the author's term, "Ergonomics").

In late 2020, Jan Giacomelli did a writeup on the state of dependency and environment management. I won't copy/paste it, but check out the table 2/3rds of the way down that post -- it's a helpful reference to determine what does what.

Then, in early 2021, Frost Ming wrote a couple of pieces on Python Development Master, or PDM, which they've written to capture the vision set out in PEP 582. First, read "You don't really need a virtualenv" which outlines some of the issues with virtual environments that PDM set out to solve. Next, read "A Review: Pipenv vs. Poetry vs. PDM" which is PDM-biased (not surprising, given the author). However, Frost Ming claims in the earlier piece to be a maintainer/contributor to pipenv, so they certainly speak from a position of experience.

After I posted one of the above in a work Slack channel, Anders replied with a talk from PyConUS 2021, in which Jeremy Paige talks about the history and state of Python packaging.

What I'm doing

I used to use venv + pip (technically virtualenv but that was before venv shipped with Python), and have recently adopted pyenv and Poetry. I'll stick with those for a while until I get a chance to play around with PDM.

links

social