One of the long-standing problems developing Python projects has been the packaging libraries. The default libraries are extremely flexible, but give users the ability to define nonsensical behavior, or omit vital data from the final package.
With PEP 517, the situation changed. Now, there's a standard to write packaging tools against, that gives them the ability to define packages in a declarative manner. Various packaging alternatives have been developed, but I'm going to focus on just a few: Poetry, flit, and enscons. The first two focus on making it easy to develop simple projects, each taking a somewhat different approach, while enscons should allow for more complicated means of building, which is necessary for some of my projects.
I'm most familiar with Poetry, because it was the first setuptools alternative I know of to support the src layout. As such, that's what I used for a while. However, in some ways it wasn't a good fit. It has a number of features I ignored or worked against, such as managing virtual environments, and making editable installs of the project next to the dev dependencies, and some operations are extremely slow. Part of my goal these next few days is to determine how much of the performance issues I ran across in Poetry several months ago are still a problem, and how specific they are to Poetry.
My ultimate goal is to migrate most of my projects from Poetry to flit, and Dennis to enscons (and later to flit), but first I want to do some basic comparisons of the three tools.
My basic plan is to make three separate projects the way I'd like to lay things out with each tool, and give them dependencies that pull a lot of stuff in. Then, for each one, time pip install . and the tool's build command, followed by pip installing the wheel.
After going through the basics with the tools, I've come to the following conclusions:
- pip installing a wheel is about the same regardless of what produced it
- pip install . is kind of slow under flit
- pip install . is still painfully slow under Poetry
- It is too late at night for me to figure out how to make enscons work. ... Okay, one more try.
- All right, I've concluded the following things about enscons: pip install . is intermediate in speed between Poetry and flit, and the documentation is super confusing. python -m SCons does not work at all, but scons appears to, so, note to my future self there.
- In summary, as janky as it is, the build-wheel-and-install might still be worth it under flit, but I should probably judge that by adapting a project that uses it, and dropping it.
I appreciate that enscons is there when I need it, but I hope to not need it much. (Also, I'm assuming I can make it work with Coconut, but I'm hoping that's a fair assumption.)