Migrate to pep517 #16
Open
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 changeset migrates the project to the new standard for building projects, described in PEP 517 – A build-system independent format for source trees, and makes the implementation of the
PyTestclass and invocation ofsetupconditional upon successful import ofsetuptools.command.test.This Setuptools functionality has been deprecated for many years - and so has the general use of Setuptools as a general "project manager" with extensible functionality for testing/development/etc. Currently, Setuptools is only intended for use to build wheels from sdists, either explicitly via a frontend such as
buildor implicitly when installing a project with Pip.The work is split into several commits and the log offers a detailed rationale for each change, with citations of the relevant standards.
This fixes #15 , even for users who get stuck with
setuptools==72.0.0.In addition to making this change, I strongly recommend building and distributing a wheel for the project. Pip also exposes this functionality directly: it's as easy as
python -m pip wheel .in the root directory, which produces a.whlfile that can be uploaded to PyPI exactly like the sdist (e.g., by usingtwine). Distributing the project this way is much more convenient for end users, as it skips a completely unnecessary "build" step for this pure-Python project. (Pip cannot install the files directly from an sdist tarball, because it can't know whethersetup.pywill demand doing something else important.) This way, building is done only once locally, and not repeatedly for/by each user.