Skip to content

build: bump trio dependency to >=0.25,<1 #6244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Oct 13, 2024

See #6243 (comment) (second issue mentioned)

There appear to be runtime issues with trio<0.25 on Python 3.13. It's not the case on Python 3.12 and below, but since we now officially support 3.13, we'll have to bump the version.

Alternatively, we could add environment markers to the dependencies list, so that we could remain on trio>=0.22,<1 on Python 3.12 and below, but that can cause issues with pip's dependency resolver in certain situations, which I hate. On the other hand, trio-websocket still hasn't published a new release with their compatibility fixes of trio>=0.25, so making the trio>=0.25,<1 requirement now would probably introduce more packaging issues for some systems.

I'll have to think about it...


$ pip install trio==0.24
$ streamlink
Traceback (most recent call last):
  File "/home/basti/venv/streamlink-313/bin/streamlink", line 5, in <module>
    from streamlink_cli.main import main
  File "/home/basti/repos/streamlink/src/streamlink_cli/main.py", line 24, in <module>
    from streamlink.stream.stream import Stream, StreamIO
  File "/home/basti/repos/streamlink/src/streamlink/stream/__init__.py", line 1, in <module>
    from streamlink.stream.dash import DASHStream
  File "/home/basti/repos/streamlink/src/streamlink/stream/dash/__init__.py", line 1, in <module>
    from streamlink.stream.dash.dash import DASHStream, DASHStreamReader, DASHStreamWorker, DASHStreamWriter
  File "/home/basti/repos/streamlink/src/streamlink/stream/dash/dash.py", line 20, in <module>
    from streamlink.stream.ffmpegmux import FFMPEGMuxer
  File "/home/basti/repos/streamlink/src/streamlink/stream/ffmpegmux.py", line 19, in <module>
    from streamlink.utils.processoutput import ProcessOutput
  File "/home/basti/repos/streamlink/src/streamlink/utils/processoutput.py", line 10, in <module>
    import trio
  File "/home/basti/venv/streamlink-313/lib/python3.13/site-packages/trio/__init__.py", line 75, in <module>
    from ._path import Path as Path
  File "/home/basti/venv/streamlink-313/lib/python3.13/site-packages/trio/_path.py", line 203, in <module>
    class Path(metaclass=AsyncAutoWrapperType):
    ...<252 lines>...
                async def with_segments(self, *pathsegments: StrPath) -> Path: ...
  File "/home/basti/venv/streamlink-313/lib/python3.13/site-packages/trio/_path.py", line 147, in __init__
    type(cls).generate_forwards(cls, attrs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/basti/venv/streamlink-313/lib/python3.13/site-packages/trio/_path.py", line 164, in generate_forwards
    raise TypeError(attr_name, type(attr))
TypeError: ('parser', <class 'module'>)
$ pip install trio==0.25
$ pytest >/dev/null && echo OK
OK

@bastimeyer
Copy link
Member Author

I decided to add environment markers for py>=313 and py<313 instead of bumping trio to >=0.25 on all Python versions.

The reason for that is that trio>=0.25 still hasn't been packaged on many Linux distros where Streamlink is packaged. Considering that those distros also (obviously) haven't been updated to Python 3.13, only bumping trio to >=0.25 on py313+ is fine.

The environment markers don't cause any issues when building Streamlink's Windows builds / Linux AppImages, so it's fine. But that's only because we set a lower version boundary, not an upper one. Pip still ignores environment markers when resolving packages on foreign platforms (e.g. building for Windows on Linux).

@bastimeyer bastimeyer merged commit 8f611a0 into streamlink:master Oct 14, 2024
23 checks passed
@bastimeyer bastimeyer deleted the build/trio-0.25 branch October 14, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant