Skip to content

Commit 9b0815d

Browse files
bastimeyerback-to
authored andcommitted
build: add pyproject.toml, switch to versioningit
- 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
1 parent 89ab021 commit 9b0815d

File tree

9 files changed

+43
-2357
lines changed

9 files changed

+43
-2357
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ source =
77
omit =
88
src/streamlink/packages/*
99
src/streamlink_cli/packages/*
10-
src/streamlink/_version.py
1110

1211
exclude_lines =
1312
pragma: no cover

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ include CHANGELOG.md
33
include README.md
44
include LICENSE*
55
include *requirements.txt
6-
include src/streamlink/_version.py
7-
include versioneer.py
86

97
recursive-include completions *
108
recursive-include docs *

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ freezegun>=1.0.0
77
flake8
88
flake8-import-order
99
shtab
10+
versioningit >=1.1.1, <2

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools >=45",
5+
"wheel",
6+
"versioningit >=1.1.1, <2",
7+
]
8+
9+
10+
# https://versioningit.readthedocs.io/en/stable/index.html
11+
[tool.versioningit]
12+
default-version = "0.0.0+unknown"
13+
14+
[tool.versioningit.vcs]
15+
method = "git"
16+
17+
[tool.versioningit.format]
18+
distance = "{version}+{distance}.{vcs}{rev}"
19+
dirty = "{version}+{distance}.{vcs}{rev}.dirty"
20+
distance-dirty = "{version}+{distance}.{vcs}{rev}.dirty"
21+
22+
[tool.versioningit.next-version]
23+
method = "null"
24+
25+
[tool.versioningit.onbuild]
26+
source-file = "src/streamlink/_version.py"
27+
build-file = "streamlink/_version.py"

setup.cfg

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ install_requires =
4949
[options.packages.find]
5050
where = src
5151

52-
[versioneer]
53-
VCS = git
54-
style = pep440
55-
versionfile_source = src/streamlink/_version.py
56-
versionfile_build = streamlink/_version.py
57-
tag_prefix =
58-
parentdir_prefix = streamlink-
59-
6052
[flake8]
6153
ignore =
6254
# W503 - line break before binary operator

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
from textwrap import dedent
55

66
from setuptools import setup
7-
8-
import versioneer
7+
from versioningit import get_cmdclasses
98

109

1110
def format_msg(text, *args, **kwargs):
@@ -77,8 +76,7 @@ def is_wheel_for_windows():
7776

7877

7978
setup(
80-
version=versioneer.get_version(),
81-
cmdclass=versioneer.get_cmdclass(),
79+
cmdclass=get_cmdclasses(),
8280
entry_points=entry_points,
8381
data_files=data_files,
8482
)

src/streamlink/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
Full documentation is available at https://streamlink.github.io.
99
1010
"""
11-
from streamlink._version import get_versions
11+
from streamlink._version import __version__
1212

13-
__version__ = get_versions()['version']
14-
del get_versions
1513
__title__ = "streamlink"
1614
__license__ = "Simplified BSD"
1715
__author__ = "Streamlink"

0 commit comments

Comments
 (0)