build: project metadata in pyproject.toml PEP621 #5438
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.
Ref #5401
Fresh PR in favor of #4441 (going to close that now).
Changes
This bumps the min version requirement of setuptools to 64.0.0 and replaces the project metadata defined in the setuptools-specific
setup.cfg
file with the standardized metadata format inpyproject.toml
(PEP621):The important part of these changes are the resulting packaging contents (sdist and bdist), as well as the packaging metadata (core metadata). Diffs shown below.
Definition of the packaging "core metadata":
The setuptools-specific pyproject configs are still considered "BETA", but that's nothing to worry about. The "custom" (aka. non-auto) package discovery of
streamlink
andstreamlink_cli
is pretty straightforward, and so is the package-data config.The additional license-files config is tagged as provisional, because PEP639 will solve the licensing mess in the package metadata spec once supported by setuptools (it'll deprecate certain core metadata fields, so this is just package-tooling specific stuff).
Resulting core metadata changes
The
Home-Page
core metadata gets replaced with theProject-Url: Homepage, ...
field.This is intended behavior of the PEP621 metadata spec because it's considered redundant. Setuptools does the correct job when writing the final package metadata by leaving out the
Home-Page
field (so do other build backends likehatch
for example).However, there's currently a bug in pip which doesn't respect the project URL defined in the
Project-Url
metadata field whenHome-Page
is missing (pypa/pip#11221) when runningpip show
without the verbose flag. That shouldn't matter too much though and it'll get fixed eventually anyway.Notes
requires-python
See https://discuss.python.org/t/requires-python-upper-limits/12663
dependencies
field for consistency reasonsstreamlinkw
entry script works fine, just like beforeBuild
Diffs
No changes in package file structure apart from version strings in the bdist (comparing the
RECORD
file):And finally, the metadata diff (with the mentioned additional minor changes)