Skip to content

Build system definition via pyproject.toml (PEP 518) #4321

@bastimeyer

Description

@bastimeyer

Checklist

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).


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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions