Switch build-backend from setuptools to hatchling #403
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.
Description
This PR switches the build system backend from
setuptoolstohatchling.Since
versioneeronly supportssetuptoolsbased projects, we drop that as well, removing the vendored copy we were including. The closest functionality I could find to that was throughhatch-vcs. This results in slightly different versions compared toversioneer, illustrated by this example:versioneer:
0.11.2+7.ga1e7e91hatch-vcs:
0.11.2.post1.dev7+ga1e7e91In switching backends we entirely replace
setup.py/setup.cfgwith the more modernpyproject.toml.Motivation and Context
When
setuptoolsbroke our builds (see #391) I wanted to explore modernizing our builds by migrating to a newer backend. There are many choices, but I settled onhatchlingbecause some other SO projects (like nextline) use it, and it's the first tab in documentation in the Python Packaging User Guide, so seems inherently recommended.How Has This Been Tested?
I have built the package, installed locally, and run the tests on this installation. I've also inspected the contents of the tarball compared to the latest version (v0.11.2) up on PyPI. I've dropped including the
tests/directory in the sdist.setuptoolswas only partially picking this up. I debated includingtests/anddocs/in the sdist, but have left them out at this time. Let me know if you feel we should include them.Types of changes
Checklist: