Skip to content

Fix CI #1304

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 3 commits into from
Apr 30, 2025
Merged

Fix CI #1304

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ packaging = [
"check-manifest==0.50",
"readme-renderer==44.0",
"build>=1.2.2,<2",
"twine>=5.1.1,<6",
"twine>=6.1.0,<7",
"wheel>=0.45.0,<1",
]

Expand Down Expand Up @@ -183,9 +183,6 @@ python = """
"""

[tool.tox.env_run_base]
pass_env = [
"GITHUB_*",
]
dependency_groups = ["testing"]
commands = [
["python", "-bb", "-m", "pytest", "--cov-report=xml", "--cov-report=term", "--cov=h2", { replace = "posargs", extend = true }]
Expand Down
16 changes: 8 additions & 8 deletions src/h2/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def receive_push_promise_in_band(self,
events = self.state_machine.process_input(
StreamInputs.RECV_PUSH_PROMISE,
)
push_event = cast(PushedStreamReceived, events[0])
push_event = cast("PushedStreamReceived", events[0])
push_event.pushed_stream_id = promised_stream_id

hdr_validation_flags = self._build_hdr_validation_flags(events)
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def receive_headers(self,

events = self.state_machine.process_input(input_)
headers_event = cast(
Union[RequestReceived, ResponseReceived, TrailersReceived, InformationalResponseReceived],
"Union[RequestReceived, ResponseReceived, TrailersReceived, InformationalResponseReceived]",
events[0],
)

Expand All @@ -1086,9 +1086,9 @@ def receive_headers(self,
)
# We ensured it's not an information response at the beginning of the method.
cast(
Union[RequestReceived, ResponseReceived, TrailersReceived],
"Union[RequestReceived, ResponseReceived, TrailersReceived]",
headers_event,
).stream_ended = cast(StreamEnded, es_events[0])
).stream_ended = cast("StreamEnded", es_events[0])
events += es_events

self._initialize_content_length(headers)
Expand All @@ -1112,15 +1112,15 @@ def receive_data(self, data: bytes, end_stream: bool, flow_control_len: int) ->
"set to %d", self, end_stream, flow_control_len,
)
events = self.state_machine.process_input(StreamInputs.RECV_DATA)
data_event = cast(DataReceived, events[0])
data_event = cast("DataReceived", events[0])
self._inbound_window_manager.window_consumed(flow_control_len)
self._track_content_length(len(data), end_stream)

if end_stream:
es_events = self.state_machine.process_input(
StreamInputs.RECV_END_STREAM,
)
data_event.stream_ended = cast(StreamEnded, es_events[0])
data_event.stream_ended = cast("StreamEnded", es_events[0])
events.extend(es_events)

data_event.data = data
Expand All @@ -1144,7 +1144,7 @@ def receive_window_update(self, increment: int) -> tuple[list[Frame], list[Event
# this should be treated as a *stream* error, not a *connection* error.
# That means we need to catch the error and forcibly close the stream.
if events:
cast(WindowUpdated, events[0]).delta = increment
cast("WindowUpdated", events[0]).delta = increment
try:
self.outbound_flow_control_window = guard_increment_window(
self.outbound_flow_control_window,
Expand Down Expand Up @@ -1228,7 +1228,7 @@ def stream_reset(self, frame: RstStreamFrame) -> tuple[list[Frame], list[Event]]

if events:
# We don't fire an event if this stream is already closed.
cast(StreamReset, events[0]).error_code = _error_code_from_int(frame.error_code)
cast("StreamReset", events[0]).error_code = _error_code_from_int(frame.error_code)

return [], events

Expand Down