my python packaging patterns

#author_luna #python #python-packaging #notes #living_article

%at=2023-07-23T18:28:44

updated %at=2025-04-09T22:44:41.275Z

these are mine. i have been writing python software for 10 years (though Python to production is more like 5yrs ago), so i know how to deal with things when they go bad (or sometimes i think about the new shiny and then i become miserable and give up on the shiny)

see Relieving your Python packaging pain Why not tell people to "simply" use pyenv, poetry or anaconda. they condense my experience (and guidelines) pretty well.

as a developer of software #

venv + pip.

i have used poetry and pipenv extensively to reach their edge cases on UX, and i don't like either. venv + pip works most of the time. uv is currently attempting to become a contender for the spot. goodl luck to them!

as a user of cli software made by others #

PEP 668 is good. pipx is what i use, sometimes i have to hax together some dependency inside the venv, but that's easy (~/.local/pipx/venvs/something/bin/pip).

as a user of cli software that i might want to use git versions of #

venv + pip.

as a machine learning researcher #

docker. it's all based on docker. having to micromanage cuda versions, gcc versions, etc, is fucking hell. i use the official nvidia images and nvidia container toolkit to make things work.

changelog #

%at=2025-04-09T22:44:41.275Z