- Add `StreamlinkCLIError` exception class
- Remove `ConsoleOutput.exit()` and remove `error` handling
from `ConsoleOutput.msg_json()`
- Handle raised `StreamlinkCLIError`s in `main()`
- Update and refactor some CLI tests
When executing tests from the build directory (generated by bdist),
the location of the Streamlink source is directly at the root directory
and not in a `src` subdirectory.
This is what Debian does when building python packages to ensure newly
built files are tested instead of source files.
- Fix `KeyboardInterrupt`/`SystemExit` exceptions
not being propagated in nested `ExceptionGroup`s
- Fix compatibility with `exceptiongroup<=1.1.1`
by avoiding their `catch()` context manager
- Add missing test for (re-)raising different exception types
- 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)
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.