[build-system] build-backend = "setuptools.build_meta" requires = [ "setuptools >=45", "wheel", "versioningit >=2.0.0, <3", ] # 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 = "{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] source-file = "src/streamlink/_version.py" build-file = "streamlink/_version.py" # 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] filterwarnings = [ "always", "ignore:::pkg_resources", ] # https://coverage.readthedocs.io/en/latest/config.html [tool.coverage.run] branch = true source = [ "src", "tests", ] [tool.coverage.report] omit = [ "src/streamlink/packages/*", "src/streamlink_cli/packages/*", ] exclude_lines = [ "pragma: no cover", "def __repr__", "raise NotImplementedError", "if __name__ == \"__main__\":", "if (?:typing\\.)?TYPE_CHECKING:", ] # https://beta.ruff.rs/docs/configuration/ [tool.ruff] src = ["src", "tests"] target-version = "py37" fix = false ignore-init-module-imports = true line-length = 128 show-source = true format = "grouped" 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-pie "PIE", # flake8-pytest-style "PT", # flake8-quotes "Q", # flake8-tidy-imports "TID", ] extend-ignore = [ "A003", # builtin-attribute-shadowing "C408", # unnecessary-collection-call "ISC003", # explicit-string-concatenation "PLC1901", # compare-to-empty-string "PLW2901", # redefined-loop-name ] extend-exclude = [ "docs/conf.py", "src/streamlink/packages/", "src/streamlink_cli/packages/", ] [tool.ruff.per-file-ignores] "__init__.py" = ["F401"] "src/streamlink/__init__.py" = ["I"] "src/streamlink/_version.py" = ["I"] "src/streamlink/plugin/api/useragents.py" = ["E501"] "src/streamlink_cli/main.py" = ["PLW0603"] [tool.ruff.isort] known-first-party = ["streamlink", "streamlink_cli"] lines-after-imports = 2 combine-as-imports = true [tool.ruff.flake8-tidy-imports] ban-relative-imports = "all" [tool.ruff.flake8-quotes] avoid-escape = false [tool.ruff.flake8-implicit-str-concat] allow-multiline = false # https://mypy.readthedocs.io/en/stable/config_file.html [tool.mypy] python_version = 3.7 show_error_codes = true show_error_context = true show_column_numbers = true warn_no_return = false files = [ "src/streamlink/", "src/streamlink_cli/", "tests/", "setup.py", ]