Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
bastimeyer opened this issue Jan 31, 2022 · 1 comment · Fixed by #4440
Closed
3 tasks done

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

bastimeyer opened this issue Jan 31, 2022 · 1 comment · Fixed by #4440

Comments

@bastimeyer
Copy link
Member

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.

@bastimeyer
Copy link
Member Author

An alternative to versioneer is pypa/setuptools_scm, but one big issue here is how it defines its default version format.

I just found out about versioningit, which is rather new (first commit in July 2021):

This seems to be exactly what I was looking for. My first tests are looking promising, with the same versioning scheme as versioneer, if configured properly. Wheels are building fine and editable installs seem to be working, too. Perfect.

This means that if there are no other obstacles, versioneer can be dropped in favor of versioningit and pyproject.toml be added for having a proper PEP 518 build environment for streamlink. And then metadata from setup.cfg can also be moved to pyproject.toml via PEP 621.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant