IMHO the best practie for now to build packages is https://pypi.org/project/pep517/, as it automatically sets up build dependencies.
I don’t know if I’d call it best practice, but more of this is the only way to do stuff correctly at this time. I guess, it’s best in the sense that it’s the only way to do this. There are still some caveats with straight up using this, but this is the approach that’ll work best for most users.
More context for anyone not familiar: Building distributions and drawing the Platypus
Not sure if I’m aware of these can you detail?
Some points to consider here:
- Pip only uses the “hook calling wrappers” functionality in
pep517, the rest of the code is relatively untested “in the wild”.
- The build environment management code is definitely not as battle-tested as pip’s (there were some nasty edge cases that pip’s code identified and addressed, I don’t know if
pep517is susceptible to them).
- The command line front end to
pep517is a very basic proof of concept. The question of whether it will remain a supported interface is still very much open for debate, and people who rely on it should be prepared for the possibility of it being removed, should a “proper” tool be developed. See this issue comment for context (disclaimer: it’s my personal view, and I’m not the project owner).
I’ve been using in all my projects all the time and never ran into any other issues.
IMHO creating a new recommended tool does not imply that
pep517 would break. Sure we might end up down the line with another tool, but until then
pep517 is a major improvement over
python setup.py invocations, and IMHO should be preferred over it.
For what it’s worth, I wish the
pep517.check functionalities were integrated into
twine. I believe it would offer a great workflow for people in the role of a Python library (or application) developer: check build backend, build distributions, check distributions, publish distributions.
(Hopefully I’m not going too far off-topic with that.)
I’ve flagged this thread for moderators to move out the discussion about
pep517 the library.