build: project metadata in pyproject.toml PEP621

Move Streamlink's project metadata from setuptools's own `setup.cfg`
to the standardized `pyproject.toml` format (PEP621)

- Bump setuptools to `>=64.0.0`
- Bump pip dev-requirement to `>=21.0.0`
- Set two `author` entries, to keep the same `Author` and `Author-email`
  core metadata in the resulting sdist and bdist packages
- Set `license.text` field instead of `license.file` and add the
  setuptools-specific `license-files` config attribute, so that
  the `License` and `License-File` core metadata doesn't change.
  License data will receive another change in the future once PEP639
  comes into effect
- By switching to PEP621 metadata, implicitly move the `Home-page`
  core metadata to `Project-URL: Homepage, ...`
- Remove upper version constraint from `requires-python`
- Reformat some version strings of the `dependencies` field
This commit is contained in:
bastimeyer 2023-07-14 15:20:14 +02:00 committed by Sebastian Meyer
parent 07d627fbef
commit 3d477cd530
4 changed files with 71 additions and 51 deletions

View File

@ -1,4 +1,5 @@
pip>=9
pip >=21.0.0
pytest >=6.0.0
pytest-asyncio
pytest-cov

View File

@ -365,7 +365,7 @@ Type Name Notes
========= ========================= ===========================================
python `Python`_ At least version **3.8**.
build `setuptools`_ At least version **45.0.0**. |br| Used as build backend.
build `setuptools`_ At least version **64.0.0**. |br| Used as build backend.
build `wheel`_ Used by the build frontend for creating Python wheels.
build `versioningit`_ At least version **2.0.0**. |br| Used for generating the version string from git
when building, or when running in an editable install.

View File

@ -1,12 +1,79 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >=45",
"setuptools >=64",
"wheel",
"versioningit >=2.0.0, <3",
]
# https://peps.python.org/pep-0621/
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
[project]
name = "streamlink"
description = """\
Streamlink is a command-line utility that extracts streams from various services and pipes them into a video player of choice.\
"""
readme = "README.md"
license = { text = "Simplified BSD" }
authors = [
{ name = "Streamlink" },
{ email = "streamlink@protonmail.com" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Video",
"Topic :: Utilities",
]
dynamic = [
"version",
"entry-points",
]
requires-python = ">=3.8"
dependencies = [
"certifi",
"isodate",
"lxml >=4.6.4,<6",
"pycountry",
"pycryptodome >=3.4.3,<4",
"PySocks >=1.5.6,!=1.5.7",
"requests >=2.26.0,<3",
"trio >=0.22.0,<1",
"trio-websocket >=0.9.0,<1",
"typing-extensions >=4.0.0",
"urllib3 >=1.26.0,<3",
"websocket-client >=1.2.1,<2",
]
[project.urls]
Homepage = "https://github.com/streamlink/streamlink"
Documentation = "https://streamlink.github.io/"
Tracker = "https://github.com/streamlink/streamlink/issues"
Source = "https://github.com/streamlink/streamlink"
Funding = "https://streamlink.github.io/latest/donate.html"
# https://setuptools.pypa.io/en/stable/userguide/pyproject_config.html
[tool.setuptools]
license-files = ["LICENSE"]
# https://versioningit.readthedocs.io/en/stable/index.html
[tool.versioningit]
default-version = "0.0.0+unknown"

View File

@ -1,55 +1,7 @@
[metadata]
name = streamlink
author = Streamlink
author_email = streamlink@protonmail.com
description = Streamlink is a command-line utility that extracts streams from various services and pipes them into a video player of choice.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/streamlink/streamlink
project_urls =
Documentation = https://streamlink.github.io/
Tracker = https://github.com/streamlink/streamlink/issues
Source = https://github.com/streamlink/streamlink
Funding = https://streamlink.github.io/latest/donate.html
license = Simplified BSD
license_files = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
License :: OSI Approved :: BSD License
Environment :: Console
Intended Audience :: End Users/Desktop
Operating System :: POSIX
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Internet :: WWW/HTTP
Topic :: Multimedia :: Sound/Audio
Topic :: Multimedia :: Video
Topic :: Utilities
[options]
python_requires = >=3.8, <4
package_dir =
=src
packages = find:
install_requires =
certifi
isodate
lxml >=4.6.4,<6
pycountry
pycryptodome >=3.4.3,<4
PySocks !=1.5.7,>=1.5.6
requests >=2.26.0,<3.0
trio >=0.22.0,<1
trio-websocket >=0.9.0,<1
typing-extensions >=4.0.0
urllib3 >=1.26.0,<3
websocket-client >=1.2.1,<2.0
[options.packages.find]
where = src