4 ms·
I'm not so sure. I went down this rabbit hole. It's really a mess. Setuptools? Poetry? Hatch? PBR? Flit? PDM? Why are there so many build systems? How do I cho
by sseagull 4y ago
I'm not so sure. I went down this rabbit hole. It's really a mess.
Setuptools? Poetry? Hatch? PBR? Flit? PDM? Why are there so many build systems? How do I choose the proper one?
The article you posted uses hatch, which I hadn't even heard of until last week.
Should I use setup.py, setup.cfg, or pyproject.toml? Things seem to moving to pyproject.toml but lots of existing functionality seems to point to setup.py. Looking for answers on SO seems to result in a mix of all different combinations.
And then there's virtual environments...
- theptip 4y agoTen years ago things were pretty bad, and I can see how it could be confusing trying to pick through all of the different options that have risen and fallen over the years. In 2022, If you're building an application and are looking for a simple answer, just use Poetry; it's similar enough to what you'll be familiar with if coming from other languages (e.g. yarn, cargo, ...). For most usecases you can just lean on Poetry's venv management; you don't need to do more than `poetry shell` or `poetry run` to get access to it. Poetry will create, and for the most part manage, your pyproject.toml file for you. If you want a bit more flexibility Virtualenv is part of python now (`python -m venv`). If you're on MacOS you can get great venv management with pyenv and pyenv-virtualenv. And for sure, things get more complex if you're building a library. But I think Poetry is a solid place to start.
- sseagull 4y agoBut this directly contradicts the link given above - the "official" python packaging tutorial recommends Hatch, and barely mentions poetry...
- h3mmy 4y agoI've used python on and off since 2009 and every time I dive back in, there's a new standard. I feel like there's several 'proper' ways to do things and I don't really mind there being different flavors of packaging frameworks. I do find it confusing because there's no real documentation of the various frameworks in one place. It makes it unappealing to invest in writing and maintaining anything in python because I don't know if the process I've used is going to deprecated soon. Just a side note, I did end up finding and using poetry a couple of weeks ago and stuck to that as I was bouncing around setuptools vs pyproject and then needing to decide whether or not I needed a makefile, etc.
- zx14 4y ago"Just use X" is not what I want to hear. Python packaging is a pile of garbage. I don't want to have to use a 3rd party tool! Just fix the damn core tools and make them consistent and intuitive! Sorry, rant over.
- staticautomatic 4y ago…and logging