I recently built a Python library for the first time in a while, and to make it available in PyPI I followed the official Python packaging guide. But it turns out there’s some rough edges in the suggested tools.
Namely, the build backend hatch puts all the files in the project directory into the built sdist, except from some files it chooses to exclude, which led to a gitignored file as well as VCS metadata getting packaged and uploaded to PyPI. This really surprised me, and I think most Python users new to packaging would be better served by choosing a conservative build backend like uv_build, which puts only the Python source modules and some specific project-level files into the sdist.
I hate python packaging. pip freeze is about as complicated as I’m willing to get with it, because all the other options horrify me.
Flit isn’t awful, but it’s still a little disappointing that it expects an explicit version string from the package and can’t take one from the
pyproject.toml, but maybe that’s changed nowWhile pipx is a good enough package manager, if your distro doesn’t ship that python project.