Skip to content
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

List tornado and traitlets as dependencies explicitly, and cleanup unreachable code #457

Merged
merged 2 commits into from Feb 23, 2024

Conversation

consideRatio
Copy link
Member

@consideRatio consideRatio commented Feb 21, 2024

We reference tornado and traitlets directly from our source code, so we should surface those dependecies.

We require jupyter-server>=1.0, which depend on tornado>=5.0 and traitlets>=4.2.1, so I'm adding our dependency on tornado and traitlets explicitly in this project, putting their lower bounds to those versions - and adding a test to verify our test suite works against those versions.

For reference, note that jupyter-server==1.1.0 released four years ago requires tornado 6.1, so I figure its safe to assume we can bump these notably without issues in the future.


This enables me to better reason about #448, as its changing something that is passed to tornado, and tornado's behavior may differ slightly between versions.

@consideRatio consideRatio changed the title Declare tornado and traitlets as dependencies explicitly List tornado and traitlets as dependencies explicitly, and cleanup reachable code Feb 21, 2024
Comment on lines -43 to -51
# for tornado 4.5.x compatibility
if version_info[0] == 4:
conn = PingableWSClientConnection(
io_loop=ioloop.IOLoop.current(),
compression_options={},
request=request,
on_message_callback=on_message_callback,
on_ping_callback=on_ping_callback,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cleaned up now that we know we required tornado 5.0 via jupyter server 1.0.0+.

Comment on lines +43 to +57
# resolver= parameter requires tornado >= 6.3. Only pass it if needed
# (for Unix socket support), so older versions of tornado can still
# work otherwise.
kwargs = {"resolver": resolver} if resolver else {}
conn = PingableWSClientConnection(
request=request,
compression_options={},
on_message_callback=on_message_callback,
on_ping_callback=on_ping_callback,
max_message_size=getattr(
websocket, "_default_max_message_size", 10 * 1024 * 1024
),
subprotocols=subprotocols,
**kwargs,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just indentation changes by no longer nesting under an else clause.

@consideRatio consideRatio changed the title List tornado and traitlets as dependencies explicitly, and cleanup reachable code List tornado and traitlets as dependencies explicitly, and cleanup unreachable code Feb 23, 2024
@consideRatio consideRatio merged commit 288c74b into jupyterhub:main Feb 23, 2024
13 checks passed
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.

None yet

2 participants