Commit Graph

43 Commits

Author SHA1 Message Date
bastimeyer 13762836c2 build: remove versioningit build-req from sdist
- Replace `tool.versioningit.onbuild` hook with a custom implementation
  which replaces the entire `streamlink._version` module (similar to
  before) and which additionally removes `versioningit` from the
  `build-system.requires` field in `pyproject.toml` and which sets
  a static version string in `setup.py`
- Rewrite `streamlink._version` module
- Add and update comments
- Update docs
- Add tests
2023-10-22 19:45:31 +02:00
bastimeyer 26dc2f6298 chore: add "T20" rules to ruff config 2023-10-17 22:54:54 +02:00
bastimeyer c29bbe55a4 chore: add "INP" rules to ruff config 2023-10-17 22:54:54 +02:00
bastimeyer 5f35523f5d chore: "RUF" rules to ruff config
And fix issues:

- Add new "noqa" annotations where needed and update "per-file-ignores"
- Remove previously needed but now unnecessary "noqa" annotations
- Update CDP generator script and regenerate the CDP modules
- Fix missing ClassVar type annotations
- Fix concatenation of collection literals
- Fix unnecessary key check
- Use type conversion flags in f-strings
- Fix miscellaneous issues
2023-10-17 22:54:54 +02:00
bastimeyer 23c74af37a tools: bump ruff to 0.1.0 2023-10-17 22:54:54 +02:00
bastimeyer 713a650efd build: add Python 3.12 to package classifiers 2023-09-29 11:45:25 +02:00
bastimeyer a9b9353a63 tools: bump ruff to 0.0.291 and fix issues 2023-09-22 20:50:22 +02:00
bastimeyer 194d9bc193 build: override setuptools build backend
- Add custom build backend which overrides certain hooks
- Include custom build backend in sdists via `MANIFEST.in`
- Remove `build>=1.0.0` workaround from `build-and-sign.sh`
- Add build backend tests, update order of tests and coverage config
2023-09-18 13:50:20 +02:00
bastimeyer 63ef2a8e6d build: set scripts/gui-scripts fields to dynamic 2023-08-16 16:48:11 +02:00
bastimeyer 628e8ab910 build: move setuptools config to pyproject.toml
- Move setuptools's package discovery config and data-files config
  to pyproject.toml
- Remove empty setup.cfg
2023-07-17 02:39:23 +02:00
bastimeyer 3d477cd530 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
2023-07-17 02:39:23 +02:00
bastimeyer 9981ddf900 script.generate-cdp: refactor
- Add inflection to dev-requirements
- Add argparser
- Add package output path
- Add version selection
- Add domain selection
- Fetch protocol JSON files from gh:ChromeDevTools/devtools-protocol
- Fetch latest version from NPMJS if unset (latest tag by date)
- Include util.py
- Clean up headers and imports of generated modules
- Re-order clean+write logic in output path
- Remove docs/sphinx related stuff
- Remove deprecation notes
- Remove custom protocol patches/hacks
- Fix generated code style
- Fix domain self-references
- Fix command param order
2023-07-03 17:49:07 +02:00
bastimeyer 7a59be1df1 tools: set ruff "target-version" to py38 2023-07-02 21:04:09 +02:00
bastimeyer c5c39efc2e tools: set mypy "python_version" to 3.8 2023-07-02 21:04:09 +02:00
bastimeyer f0236e1509 tests: ignore DeprecationWarning in pycountry
The stacklevel of the DeprecationWarning raised by `pkg_resources`
got changed in setuptools 68.0.0, so we have to adjust our warnings
filter.

`pycountry` is still importing `pkg_resources`.
2023-06-21 18:12:08 +02:00
bastimeyer 3fcf6d6c09 tools: bump ruff to 0.0.272 and fix issues 2023-06-09 14:25:42 -07:00
bastimeyer 45e515eb5a session/plugin: fix DeprecationWarning stacklevel 2023-03-24 09:41:23 -07:00
bastimeyer 5e6f03c3cd chore: add "B" rules to ruff config 2023-03-24 09:41:23 -07:00
bastimeyer 90ccc1039c tools: bump ruff to 0.0.259 2023-03-24 09:38:59 -07:00
bastimeyer 5381095948 tools: pinpoint ruff to 0.0.255 and fix rules 2023-03-13 20:30:53 +01:00
bastimeyer 5ff3b32ce5 tests: ignore all pkg_resources warnings
Follow-up of c3ff5a0.

Ignore all warnings raised by `pkg_resources`:
New `DeprecationWarning`s were added by setuptools 67.5.0
2023-03-09 16:39:54 +01:00
bastimeyer 49988a0923 chore: aware datetimes
- Add "DTZ" ruff rule
- Add utility functions to `streamlink.utils.times` which use
  "aware" datetimes with explicit timezone information,
  and use `isodate`'s local timezone implementation
- Replace all "naive" datetimes without timezone information
- Replace all custom ISO8601 parsers with `isodate`'s implementation
- Add tests for new utility functions
2023-03-01 09:59:47 -08:00
bastimeyer 3fa7e7646d tools: ignore PLW0603 ruff rule 2023-02-27 20:28:10 +01:00
bastimeyer de42968bde tools: bump ruff to >=0.0.252 and ignore PLW2901 2023-02-22 21:46:35 +01:00
bastimeyer 85ea235d13 chore: add "A" rules to ruff config 2023-02-20 14:10:06 -08:00
bastimeyer ba78ad2ec3 chore: add "PIE" rules to ruff config 2023-02-20 14:10:06 -08:00
bastimeyer 9cfe62d03c chore: add "PL{C,E,W}" rules to ruff config 2023-02-20 14:10:06 -08:00
bastimeyer af081aa249 chore: add "PT" rules to ruff config 2023-02-15 17:29:22 -08:00
bastimeyer c3ff5a0090 tests: ignore setuptools 67.3.0 DeprecationWarning
Ignore new `pkg_resources.declare_namespace` DeprecationWarning
which was added in the setuptools 67.3.0 release.
2023-02-15 10:13:05 -08:00
bastimeyer 4622c9728e chore: add "ISC" rules to ruff config 2023-02-09 11:48:40 -08:00
bastimeyer 17daf563a3 chore: add "C4" rules to ruff config 2023-02-09 11:48:40 -08:00
bastimeyer 57fa6f80e8 chore: add "COM" rules to ruff config 2023-02-09 10:26:50 -08:00
bastimeyer 9fd14e3f9d chore: add "Q" rules to ruff config 2023-02-09 10:26:50 -08:00
bastimeyer faab9200c7 chore: add "I" and "TID" rules to ruff config 2023-02-09 10:26:50 -08:00
bastimeyer 98596e9331 tools: replace flake8 with ruff 2023-02-09 09:54:14 -08:00
bastimeyer 2f7396ba24 tools: check typing in docs dir separately 2023-01-26 09:42:34 -08:00
bastimeyer 2d74c69882 tests: set filterwarnings=always via pytest config
- Add pytest config to pyproject.toml
- Set pytest 6.0.0 as minimum version via dev-requirements.txt
- Remove unneeded filterwarnings("always") calls from tests
2023-01-14 20:14:33 -08:00
bastimeyer fe9be00832 chore: ignore coverage in TYPE_CHECKING blocks 2023-01-14 07:47:08 +01:00
bastimeyer 7039b4b3a1 tools: move list of files to mypy config
- Move list of files from CI config to mypy config in pyproject.toml,
  so that mypy can be run locally without having to specificy the same
  inputs as CLI arguments. Keep --no-incremental exclusive to CI runner.
- Update Python version of mypy CI runner.
- Fix typing ignore comment when importing importlib_metadata fallback
  in the streamlink_cli.compat module.
2022-11-08 13:24:47 +01:00
bastimeyer cfb482cac7 build: upgrade versioningit to >=2.0.0, <3
and update deprecated version format strings:
https://github.com/jwodder/versioningit/blob/v2.0.0/CHANGELOG.md
2022-06-14 15:55:16 -07:00
bastimeyer 334e18e412 tools: add mypy config
- Add mypy and available typing stubs to dev-requirements
- Add mypy config
- Add py.typed to streamlink + streamlink_cli packages (PEP 561):
  This is required, so that mypy can import types from streamlink when
  installed in editable mode. Don't publish this file for now.
  Once various streamlink APIs are properly typed, typing stub files
  can be added instead.
2022-05-24 14:07:47 -07:00
bastimeyer 9dca2cef42 chore: move coverage config to pyproject.toml 2022-04-22 10:45:08 -07:00
bastimeyer 9b0815dbee 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
2022-04-10 07:55:31 +02:00