Packaging in Python has been notoriously confusing for newcomers.
How should I structure the directories? What is the difference between
setup.py and setup.cfg? How do they relate to a requirements.txt? Why do I
need a MANIFEST.in file? Do I need tox or nox, and what are they for? Why
is flake8 ignoring my pyproject.toml file? What’s the deal with virtual
environments?
Luckily, this has been simplified a lot in recent years, in substantial part
thanks to uv.
I finally (and hopefully permanently) converged on what I call a canonical Python project
template. If you are new to Python or generally confused about Python packaging,
this blog article is for you. Find the
copier template at the end.