mirror of https://github.com/streamlink/streamlink
274 lines
6.7 KiB
TOML
274 lines
6.7 KiB
TOML
[build-system]
|
|
requires = [
|
|
"setuptools >=65.6",
|
|
"wheel",
|
|
# The versioningit build-requirement gets removed from the source distribution,
|
|
# as the version string is already built into it (see the onbuild versioningit hook):
|
|
"versioningit >=2.0.0,<4", # disabled in sdist
|
|
]
|
|
# setuptools build-backend override
|
|
# https://setuptools.pypa.io/en/stable/build_meta.html
|
|
backend-path = ["build_backend"]
|
|
build-backend = "__init__"
|
|
|
|
|
|
# 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",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Topic :: Internet :: WWW/HTTP",
|
|
"Topic :: Multimedia :: Sound/Audio",
|
|
"Topic :: Multimedia :: Video",
|
|
"Topic :: Utilities",
|
|
]
|
|
|
|
dynamic = [
|
|
"version",
|
|
"entry-points",
|
|
"scripts",
|
|
"gui-scripts",
|
|
]
|
|
|
|
requires-python = ">=3.8"
|
|
dependencies = [
|
|
"certifi",
|
|
"exceptiongroup",
|
|
"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
|
|
# https://setuptools.pypa.io/en/stable/userguide/package_discovery.html
|
|
# https://setuptools.pypa.io/en/stable/userguide/datafiles.html
|
|
[tool.setuptools]
|
|
license-files = ["LICENSE"]
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
namespaces = false
|
|
|
|
[tool.setuptools.package-data]
|
|
streamlink = [
|
|
"py.typed",
|
|
]
|
|
"streamlink.plugins" = [
|
|
"_plugins.json",
|
|
]
|
|
|
|
|
|
# https://versioningit.readthedocs.io/en/stable/index.html
|
|
[tool.versioningit]
|
|
# Packagers: don't patch the `default-version` string while using the tarball built by GitHub from the tagged git commit!
|
|
# Instead, use Streamlink's signed source distribution as package source, which has the correct version string built in.
|
|
# This fallback `default-version` string is only used when not building from the sdist or a git repo with at least one tag.
|
|
# See the versioningit comment at the very top of this file!
|
|
default-version = "0.0.0+unknown"
|
|
|
|
[tool.versioningit.vcs]
|
|
method = "git"
|
|
|
|
[tool.versioningit.format]
|
|
distance = "{base_version}+{distance}.{vcs}{rev}"
|
|
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
|
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
|
|
|
[tool.versioningit.next-version]
|
|
method = "null"
|
|
|
|
[tool.versioningit.onbuild]
|
|
# When building the sdist or wheel, remove versioningit build-requirement and set the static version string
|
|
method = { module = "build_backend.onbuild", value = "onbuild" }
|
|
|
|
|
|
# https://docs.pytest.org/en/latest/reference/customize.html#configuration
|
|
# https://docs.pytest.org/en/latest/reference/reference.html#ini-options-ref
|
|
[tool.pytest.ini_options]
|
|
testpaths = [
|
|
"build_backend",
|
|
"tests",
|
|
]
|
|
filterwarnings = [
|
|
"always",
|
|
]
|
|
|
|
|
|
# https://coverage.readthedocs.io/en/latest/config.html
|
|
[tool.coverage.run]
|
|
branch = true
|
|
source = [
|
|
"build_backend",
|
|
"src",
|
|
"tests",
|
|
]
|
|
|
|
[tool.coverage.report]
|
|
omit = [
|
|
"build_backend/commands.py",
|
|
"src/streamlink/packages/*",
|
|
"src/streamlink/webbrowser/cdp/devtools/*",
|
|
"src/streamlink_cli/packages/*",
|
|
"src/streamlink_cli/_parser.py",
|
|
]
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"def __repr__",
|
|
"raise NotImplementedError",
|
|
"if __name__ == \"__main__\":",
|
|
"if (?:typing\\.)?TYPE_CHECKING:",
|
|
]
|
|
|
|
|
|
# https://docs.astral.sh/ruff/configuration/
|
|
[tool.ruff]
|
|
src = [
|
|
"build_backend",
|
|
"src",
|
|
"tests",
|
|
]
|
|
target-version = "py38"
|
|
fix = false
|
|
line-length = 128
|
|
output-format = "full"
|
|
preview = true
|
|
extend-exclude = [
|
|
"docs/conf.py",
|
|
"src/streamlink/packages/",
|
|
"src/streamlink_cli/packages/",
|
|
]
|
|
|
|
[tool.ruff.lint]
|
|
ignore-init-module-imports = true
|
|
select = [
|
|
# pycodestyle
|
|
"E",
|
|
"W",
|
|
# pyflakes
|
|
"F",
|
|
# pylint
|
|
"PLC",
|
|
"PLE",
|
|
"PLW",
|
|
# isort
|
|
"I",
|
|
# flake8-builtins
|
|
"A",
|
|
# flake8-bugbear
|
|
"B",
|
|
# flake8-commas
|
|
"COM",
|
|
# flake8-comprehensions
|
|
"C4",
|
|
# flake8-datetimez
|
|
"DTZ",
|
|
# flake8-implicit-str-concat
|
|
"ISC",
|
|
# flake8-no-pep420
|
|
"INP",
|
|
# flake8-pie
|
|
"PIE",
|
|
# flake8-print
|
|
"T20",
|
|
# flake8-pytest-style
|
|
"PT",
|
|
# flake8-quotes
|
|
"Q",
|
|
# flake8-tidy-imports
|
|
"TID",
|
|
# Ruff-specific rules
|
|
"RUF",
|
|
]
|
|
ignore = [
|
|
"A003", # builtin-attribute-shadowing
|
|
"C408", # unnecessary-collection-call
|
|
"ISC003", # explicit-string-concatenation
|
|
"PLC1901", # compare-to-empty-string
|
|
"PLC2801", # unnecessary-dunder-call
|
|
"PLW2901", # redefined-loop-name
|
|
"RUF021", # parenthesize-chained-operators
|
|
"RUF022", # unsorted-dunder-all
|
|
"RUF027", # missing-f-string-syntax
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"__init__.py" = ["F401"]
|
|
"docs/**" = ["INP", "RUF012"]
|
|
"script/**" = ["INP"]
|
|
"src/streamlink/__init__.py" = ["I"]
|
|
"src/streamlink/_version.py" = ["I"]
|
|
"src/streamlink/plugin/api/useragents.py" = ["E501"]
|
|
"src/streamlink/plugins/*" = ["RUF012"]
|
|
"src/streamlink/webbrowser/cdp/devtools/*" = ["E303", "E501", "F401"]
|
|
"src/streamlink_cli/main.py" = ["PLW0603"]
|
|
"tests/**" = ["RUF012"]
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-first-party = ["streamlink", "streamlink_cli"]
|
|
lines-after-imports = 2
|
|
combine-as-imports = true
|
|
|
|
[tool.ruff.lint.flake8-tidy-imports]
|
|
ban-relative-imports = "all"
|
|
|
|
[tool.ruff.lint.flake8-quotes]
|
|
avoid-escape = false
|
|
|
|
[tool.ruff.lint.flake8-implicit-str-concat]
|
|
allow-multiline = false
|
|
|
|
|
|
# https://mypy.readthedocs.io/en/stable/config_file.html
|
|
[tool.mypy]
|
|
python_version = 3.8
|
|
show_error_codes = true
|
|
show_error_context = true
|
|
show_column_numbers = true
|
|
warn_no_return = false
|
|
files = [
|
|
"build_backend",
|
|
"src/streamlink/",
|
|
"src/streamlink_cli/",
|
|
"tests/",
|
|
"setup.py",
|
|
]
|