-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Checklist
- This is a feature request and not a different kind of issue
- I have read the contribution guidelines
- I have checked the list of open and recently closed plugin requests
Description
As mentioned in #4113, Streamlink will have to switch to the declarative build system via pyproject.toml
eventually (PEP 518). Implicit setuptools-based build systems via standalone setup.py
files are deprecated.
Since this requires a major version bump, this should ideally be done in one go with other breaking changes like the removal of py36 support.
Metadata definitions (PEP 621) could be moved too, but don't have to (AFAIA).
- https://www.python.org/dev/peps/pep-0518/
- https://www.python.org/dev/peps/pep-0621/
- https://packaging.python.org/en/latest/tutorials/packaging-projects/
- https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/
- https://setuptools.pypa.io/en/latest/build_meta.html
The problem Streamlink currently has with this transition is that it uses versioneer for defining its version string, and this doesn't work well with pyproject.toml projects. The main issue here are editable installs via pip install -e .
, and the version does not get set correctly. Versioneer also unfortunately doesn't support pyproject.toml build systems yet, so the version still has to be defined in setuptools' setup()
call.
An alternative to versioneer is pypa/setuptools_scm, but one big issue here is how it defines its default version format. While versioneer simply uses the format of git describe --tags --dirty
(as defined in setup.cfg
and in src/streamlink/_version.py
), setuptools_scm "normalizes" the git describe output and automatically applies pre/post/dev release tags according to PEP 440. I still haven't figured out how to disable this behavior and keep the current version format.