diff --git a/pyproject.toml b/pyproject.toml index 9035d3955..0830a91d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] @@ -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 }] diff --git a/src/h2/stream.py b/src/h2/stream.py index d102b056c..d6f5845c3 100644 --- a/src/h2/stream.py +++ b/src/h2/stream.py @@ -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) @@ -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], ) @@ -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) @@ -1112,7 +1112,7 @@ 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) @@ -1120,7 +1120,7 @@ def receive_data(self, data: bytes, end_stream: bool, flow_control_len: int) -> 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 @@ -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, @@ -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