I finally spent some time figuring out a minimal way of developing and packaging a Python library using a pyproject.toml file

It turns out you can do it with just a pyproject.toml file - no setup.py, no setup.cfg - and the only tools you need are pip and build, with no need to use Poetry/Hatch/Flit/etc for the simplest case

til.simonwillison.net/python/p

This is my first attempt at packaging without setup.py so I'm nervous I may have missed some important details or got things wrong - eager to hear feedback on this from Python packaging experts

In particular I'm not at all confident I understand how pip and build automatically discover Python modules and packages - a note on my confusion about that here: til.simonwillison.net/python/p

OK, I'm getting pretty comfortable with this pattern now - I just shipped pocket-to-sqlite 0.2.3 to PyPI, my first package to work using just a pyproject.toml file with no setup.py github.com/dogsheep/pocket-to-

Follow

@simon You really should specify the build system there. Not specifying it isn't saying, "pip, handle this for me" it's actually conveying, "I created this file in the period of time after tools other than pip started using it but before pip did."

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.