Skip to content

build: add pyproject.toml, switch to versioningit #4440

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

Merged
merged 1 commit into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ source =
omit =
src/streamlink/packages/*
src/streamlink_cli/packages/*
src/streamlink/_version.py

exclude_lines =
pragma: no cover
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include CHANGELOG.md
include README.md
include LICENSE*
include *requirements.txt
include src/streamlink/_version.py
include versioneer.py

recursive-include completions *
recursive-include docs *
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ freezegun>=1.0.0
flake8
flake8-import-order
shtab
versioningit >=1.1.1, <2
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >=45",
"wheel",
"versioningit >=1.1.1, <2",
]


# https://versioningit.readthedocs.io/en/stable/index.html
[tool.versioningit]
default-version = "0.0.0+unknown"

[tool.versioningit.vcs]
method = "git"

[tool.versioningit.format]
distance = "{version}+{distance}.{vcs}{rev}"
dirty = "{version}+{distance}.{vcs}{rev}.dirty"
distance-dirty = "{version}+{distance}.{vcs}{rev}.dirty"

[tool.versioningit.next-version]
method = "null"

[tool.versioningit.onbuild]
source-file = "src/streamlink/_version.py"
build-file = "streamlink/_version.py"
8 changes: 0 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ install_requires =
[options.packages.find]
where = src

[versioneer]
VCS = git
style = pep440
versionfile_source = src/streamlink/_version.py
versionfile_build = streamlink/_version.py
tag_prefix =
parentdir_prefix = streamlink-

[flake8]
ignore =
# W503 - line break before binary operator
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from textwrap import dedent

from setuptools import setup

import versioneer
from versioningit import get_cmdclasses


def format_msg(text, *args, **kwargs):
Expand Down Expand Up @@ -77,8 +76,7 @@ def is_wheel_for_windows():


setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
cmdclass=get_cmdclasses(),
entry_points=entry_points,
data_files=data_files,
)
4 changes: 1 addition & 3 deletions src/streamlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
Full documentation is available at https://streamlink.github.io.

"""
from streamlink._version import get_versions
from streamlink._version import __version__

__version__ = get_versions()['version']
del get_versions
__title__ = "streamlink"
__license__ = "Simplified BSD"
__author__ = "Streamlink"
Expand Down
Loading