decouple cli from setuptools to allow new build backend integrations #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
So far, the CLI has relied on setuptools and had
setuptoolsin its indirect import path. To make plux work with other build backends, we need to abstract build-tool specific code from the CLI, and instead encapsulate it somewhere.This PR introduces an abstraction,
Project, over which the CLI is generalized. It's a bit of a kitchen-sink of factories right now, but I think it's decent enough to integrate new build backends.The CLI now has a generic method
_load_project, and each build tool has their ownProjectimplementation that uses build-tool-specific APIs (such as locating packages, or information where the generatedentry_points.txtlives in the context of the local distribution).I also added a ton of inline code documentation.
Changes
plux.buildpackageProjectas a conceptFuture work
plux.build.hatchlingcan now be implemented :-) in an initial step at least to a degree that the manual build mode workspython -m build --config-setting plux-discover-plugins=Truecould be useful to do simplifypython -m plux entrypoints && python -m build