Switch to fully pyproject.tml-based build #113
Merged
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.
This PR switches us to a fully pyproject.toml-based build.
We were previously partially using a PEP 517 build using setuptools for
pip install
s, but still using the deprecated setup.py commands for building wheels and sdist.This PR additionally migrates our project metadata from setup.py to pyproject.toml (PEP 621).
Build backend and dynamic versioning
We were previously using setuptools as a build backend and versioneer for dynamic versioning from git.
I tried 3 different backend setups that would maintain this functionality:
I found that
pdm-pep517
worked the best with the sanest defaults and required the least configuration.Versioneer does support declaring Versioneer's tool configuration in pyproject.toml, but unfortunately Versioneer still seems to require having a setup.py. I got a runtime error that setup.py was missing when trying to refresh our Versioneer setup with the latest version of Versioneer.
setuptools_scm is another package that provides dynamic versioning from git, and is used as an example in setuptools' docs for doing so. The dynamic versioning part worked fine. Unfortunately, a side effect is that there isn't a way to turn off setuptools_scm's other feature which is to automatically include all files tracked by git in the build. It was difficult and annoying to have to then wrangle
MANIFEST.in
to exclude all of these files.We may also consider getting rid of the dynamic versioning functionality, but I didn't want to take on that decision in this PR. The main benefit that it provides right now is that the version string we label the post-save initialization code with will be distinguishable between development versions of nbautoexport vs releases.