Replies: 2 comments 6 replies
-
(I didn't intend for this to come across as pugnacious, but perhaps bewildered. It's astonishing to me that this space would fill up with so many alternatives, particularly when tool-discovery and choice-paralysis are exactly what they're all trying to address. I'm sure there's an XKCD for that.) |
Beta Was this translation helpful? Give feedback.
-
For pure Python, we should follow the packaging.python.org recommendation (which I wrote) and use hatchling. It is absolutely not Poetry, which does not follow standards, and has some bad shortcomings. If you want to use hatch with hatchling, I guess you can; I'm waiting to try hatch until it has some locking support; I'll continue to use PDM until then. But Hatch (the CLI tool) and PDM can use any PEP 621 backend1. The 11 backends in a single tools has been fantastic in helping backends (including setuptools) improve their support for standards. Currently it's really classic setuptools, poetry, and then all the PEP 621 backends are nearly the same.
This is sort of the opposite of what we are trying to address. Up until very recently, there was one and only one choice. Setuptools. Nothing else. Even if coding anything even slightly complex for it was horrific. Even when it didn't support anything we need, like selecting the C++ standard. This is where all the "hack" packages came out, like scikit-build. Now we finally can build a better tool, and it's okay to pick the one that best matches your problem. I'm hopeing to make scikit-build a fantastic choice for CMake. I'm hoping mesonpy becomes a fantastic choice for Meson. Great packages come about because there is choice. Jax & PyTorch took a lot of inspiration from TensorFlow and the other packages that came before them. I'm all for making an existing package better, but choice is needed to allow ideas to develop. The packaging space in Python had no choice at all before. Choice paralysis of course can be a problem. The problem really is that I can't put nice recommendations into the choice list. If you don't know what to select:
I'd love to be able to add a little description or simi-hide some choices, but last I checked cookiecutter didn't let you do that. PS: The good news is as long as you don't pick Poetry or classic setuptools, you can switch between backends by changing two lines. Differences come to speed, how source files are included, if you can use VCS versioning, better/worse error messages, and what plugins are supported (if any are). Hatchling is dominating in all those categories right now (except maybe plugins, but it's coming). Footnotes |
Beta Was this translation helpful? Give feedback.
-
When I was last here, there were (I think) four backends, covering a basis set that included pure Python, pybind11, classic setuptools, new workflows like poetry. Starting a repo, which might or might not be the start of a project (because a common pattern is to do some offline development and then copy the results of that into a cookie-cut shell), I'm going to know basic things like whether I'll be needing pybind11 or a Rust compiler, or whether I want to go old-school setuptools or use a new all-in-one manager, but I'm not going to know whether I need
I had been thinking that this cookiecutter was for simplifying the process of getting a shell that I can put my code into, so that I don't need to set up pre-commit.ci, GitHub Actions, PyPI deployment, and all that. Because that set of DevOps tools (black, flake8, pylint, mypy, isort, ...) has more configuration options than I want to think about; I just want a set of good defaults. And when I run into issues, I'll modify my copy of the configurations, as needed.
But the number of simplifying tools is starting to rival the number of things that they simplify!
I guess it's great that scikit-hep/cookiecutter can produce hatch repos, if a user knows what hatch is and wants to use it, but do we have a recommended manager tool for pure Python repos? Is it poetry?
I'm about to make a repo for Awkward Pandas, to start on this roadmap item. It will be pure Python, but depend on
awkward
andpandas
.Beta Was this translation helpful? Give feedback.
All reactions