Commit Graph

59 Commits

Author SHA1 Message Date
bastimeyer 78d0b58d75 build: set trio min-requirement back to 0.22
- set `strict_exception_groups=True` in `CDPClient.launch()`
- monkey-patch `trio.run()` early in Streamlink's tests
2024-03-22 20:11:10 +01:00
bastimeyer 1a7295b110 webbrowser: fix compatibility with trio 0.25
- Set min. version requirement of `trio` to `0.25`,
  so we don't have to set `strict_exception_groups` to `True` on older
  versions (probably not even possible via `pytest-trio`)
- Fix compatibility with `trio>=0.25`:
  Since `strict_exception_groups` now defaults to `True`, trio nurseries
  now always raise an `ExceptionGroup` in all cases, so update tests
  and handle exception groups instead. Don't unwrap exception groups
  for now, even if only a single exception is included.
  Explicitly handle `KeyboardInterrupt`/`SystemExit` and re-raise
  by using the `exceptiongroup.catch` utility (<py311 compat)
2024-03-18 00:04:35 +01:00
bastimeyer af4c69188a build: add exceptiongroup dependency
Add the `exceptiongroup` dependency directly to Streamlink, so we
can write `ExceptionGroup` handling code on all supported versions
of Python without having to rely on `trio`'s conditional dependency.
2024-03-18 00:04:35 +01:00
bastimeyer 764beeca4f build: set trio dependency to <0.25 for now 2024-03-17 11:11:55 +01:00
bastimeyer 1e5c808898 tests: remove unneeded dateutil warning filter 2024-03-06 10:49:18 +01:00
bastimeyer 61cec0e88e build: bump setuptools to >=65.6 2024-02-19 18:29:57 +01:00
bastimeyer 8295cd2978 tools: bump ruff to 0.2.2 and fix issues 2024-02-18 14:44:58 +01:00
bastimeyer 9273253534 tools: bump ruff to 0.2.1 and fix issues 2024-02-14 21:58:02 +01:00
bastimeyer 15da679ddd cli: ignore coverage in _parser util module 2024-02-14 13:54:18 +01:00
bastimeyer 115c2ed486 build: build and include plugins JSON in wheels 2024-02-14 13:26:18 +01:00
bastimeyer a31b123d36 tools: bump ruff to 0.2.0 and update config 2024-02-02 01:21:44 +01:00
bastimeyer 61a4f33905 tools: bump ruff to 0.1.14 and fix issues 2024-01-25 18:14:59 +01:00
bastimeyer 89716761ad tools: bump ruff to 0.1.13 and fix issues 2024-01-13 17:09:27 +01:00
bastimeyer 78a4b473db tests: ignore dateutil DeprecationWarning 2023-12-31 16:03:12 +01:00
bastimeyer 4db3dac594 tests: remove unneeded pycountry warning filters 2023-12-14 06:40:08 +01:00
bastimeyer 83a6315afe build: add support for versioningit >=3.0.0
Keep backward compatibility for `versioningit <3.0.0`
2023-12-14 05:17:18 +01:00
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