build: add pyproject.toml, switch to versioningit#4440
Merged
Conversation
6c956f6 to
636a8ee
Compare
- Add basic pyproject.toml with build-system information - Drop versioneer in favor of versioningit - Delete versioneer install module and remove its setup.cfg config - Replace `src/streamlink/_version.py` and load streamlink's version string via versioningit. The module's `__version__` export will get replaced by a static string on build-time when creating sdists/wheels, which results in the old versioneer behavior with support for editable installs. - Make versioningit use the same version format as versioneer - Update MANIFEST.in and .coveragerc
636a8ee to
ac19f46
Compare
Member
Author
|
This will also require an update of the install dependencies in the docs and dev-requirements. pip 10.0.0 introduced support for PEP 517/518, but there were many changes afterwards, and I think it'd be best to require at least pip version 21.0.0, which was released in January 2021. This release also dropped support for Python 2. I will update this after #4441 was merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
src/streamlink/_version.pyand load streamlink's versionstring via versioningit. The module's
__version__export will getreplaced by a static string on build-time when creating sdists/wheels,
which results in the old versioneer behavior with support for
editable installs.
Resolves #4321
This needs to be thoroughly reviewed before it can be merged. I'm opening this as a draft for now.
I've set the required setuptools version to >=45, which is the one which breaks compatibility with python 2. A higher version could be set here, but it's probably not necessary. At least version 42 is necessary for PEP 517/518.
The version string format generated by versioningit remains the same, so it'll be one of these, depending on the current state
{version}{version}+{distance}.{vcs}{rev}{version}+{distance}.{vcs}{rev}.dirtyEditable installs via
pip install -e .should be working. Please seesrc/streamlink/_version.py, which loads the current version from versioningit unless the file's__version__export was replaced during build-time (sdist/bdist) with a static version string.The next step would be moving the project metadata from
setup.pytopyproject.toml, and dependencies from{dev,docs}-requirements.txtto theproject.optional-dependenciestable ofpyproject.toml. Maybe also properly defining dev- and doc-dependency version ranges would be a wise idea, at least minimum versions. I'd also love to have a dependency lockfile here, but that can be done later.