Skip to content

Commit c863224

Browse files
authored
Merge pull request #17 from jawah/release-5.0.8
Release 5.0.8
2 parents 9f95cc8 + 393b5bb commit c863224

File tree

8 files changed

+49
-39
lines changed

8 files changed

+49
-39
lines changed

.github/workflows/CI.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
os: [ubuntu-22.04, macos-13, windows-latest ]
38-
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
38+
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11']
3939
runs-on: ${{ matrix.os }}
4040
steps:
4141
- uses: actions/checkout@v4
@@ -83,7 +83,7 @@ jobs:
8383
fail-fast: false
8484
matrix:
8585
os: [ ubuntu-22.04, macos-13, windows-latest ]
86-
python_version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10' ]
86+
python_version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11' ]
8787
runs-on: ${{ matrix.os }}
8888
steps:
8989
- uses: actions/checkout@v4
@@ -125,7 +125,7 @@ jobs:
125125
fail-fast: false
126126
matrix:
127127
target: [x86_64, aarch64, armv7, s390x, ppc64le, ppc64, i686]
128-
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', '3.13t']
128+
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11', '3.13t']
129129
manylinux: ['auto', 'musllinux_1_1']
130130
exclude:
131131
- manylinux: musllinux_1_1
@@ -171,7 +171,7 @@ jobs:
171171
fail-fast: false
172172
matrix:
173173
target: [x64, aarch64, x86]
174-
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', '3.13t']
174+
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11', '3.13t']
175175
exclude:
176176
- target: aarch64
177177
python_version: 'pypy-3.7'
@@ -181,6 +181,8 @@ jobs:
181181
python_version: 'pypy-3.9'
182182
- target: aarch64
183183
python_version: 'pypy-3.10'
184+
- target: aarch64
185+
python_version: 'pypy-3.11'
184186
- target: x86
185187
python_version: 'pypy-3.7'
186188
- target: x86
@@ -189,6 +191,8 @@ jobs:
189191
python_version: 'pypy-3.9'
190192
- target: x86
191193
python_version: 'pypy-3.10'
194+
- target: x86
195+
python_version: 'pypy-3.11'
192196
- target: x86
193197
python_version: '3.13t'
194198
steps:
@@ -237,7 +241,7 @@ jobs:
237241
fail-fast: false
238242
matrix:
239243
target: [universal2]
240-
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', '3.13t']
244+
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10', 'pypy-3.11', '3.13t']
241245
steps:
242246
- uses: actions/checkout@v4
243247
- uses: actions/setup-python@v5

CHANGELOG.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Release History
22
===============
33

4+
5.0.8 (2025-03-06)
5+
------------------
6+
7+
- Add PyPy 3.11 pre-built optimized build in CI/CD
8+
- Backported "Use bytearray() in FrameBuffer" from upstreams for improved performance
9+
- (rust) Upgrade pyo3 from 0.23.4 to 0.23.5
10+
411
5.0.7 (2025-01-21)
512
------------------
613

Cargo.lock

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jh2"
3-
version = "5.0.7"
3+
version = "5.0.8"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

jh2/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
from __future__ import annotations
99

10-
__version__ = "5.0.7"
10+
__version__ = "5.0.8"

jh2/frame_buffer.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FrameBuffer:
3030
"""
3131

3232
def __init__(self, server=False):
33-
self.data = b""
33+
self._data = bytearray()
3434
self.max_frame_size = 0
3535
self._preamble = b"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" if server else b""
3636
self._preamble_len = len(self._preamble)
@@ -53,7 +53,7 @@ def add_data(self, data):
5353
self._preamble_len -= of_which_preamble
5454
self._preamble = self._preamble[of_which_preamble:]
5555

56-
self.data += data
56+
self._data += data
5757

5858
def _validate_frame_length(self, length):
5959
"""
@@ -119,33 +119,33 @@ def __iter__(self):
119119
def __next__(self):
120120
# First, check that we have enough data to successfully parse the
121121
# next frame header. If not, bail. Otherwise, parse it.
122-
if len(self.data) < 9:
122+
if len(self._data) < 9:
123123
raise StopIteration()
124124

125125
try:
126-
f, length = Frame.parse_frame_header(self.data[:9])
126+
f, length = Frame.parse_frame_header(memoryview(self._data[:9]))
127127
except (InvalidDataError, InvalidFrameError) as e: # pragma: no cover
128128
raise ProtocolError("Received frame with invalid header: %s" % str(e))
129129

130130
# Next, check that we have enough length to parse the frame body. If
131131
# not, bail, leaving the frame header data in the buffer for next time.
132-
if len(self.data) < length + 9:
132+
if len(self._data) < length + 9:
133133
raise StopIteration()
134134

135135
# Confirm the frame has an appropriate length.
136136
self._validate_frame_length(length)
137137

138138
# Try to parse the frame body
139139
try:
140-
f.parse_body(memoryview(self.data[9 : 9 + length]))
140+
f.parse_body(memoryview(self._data[9 : 9 + length]))
141141
except InvalidDataError:
142142
raise ProtocolError("Received frame with non-compliant data")
143143
except InvalidFrameError:
144144
raise FrameDataMissingError("Frame data missing or invalid")
145145

146146
# At this point, as we know we'll use or discard the entire frame, we
147147
# can update the data.
148-
self.data = self.data[9 + length :]
148+
self._data = self._data[9 + length :]
149149

150150
# Pass the frame through the header buffer.
151151
f = self._update_header_buffer(f)

pyproject.fb.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ build-backend = "hatchling.build"
66
name = "jh2"
77
description = "HTTP/2 State-Machine based protocol implementation"
88
readme = "README.rst"
9-
license-files = { paths = ["LICENSE"] }
109
license = "MIT"
1110
keywords = ["http2", "hpack", "h2"]
1211
authors = [

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ build-backend = "maturin"
66
name = "jh2"
77
description = "HTTP/2 State-Machine based protocol implementation"
88
readme = "README.rst"
9-
license-files = { paths = ["LICENSE"] }
109
license = "MIT"
10+
license-files = ["LICENSE"]
1111
keywords = ["http2", "hpack", "h2"]
1212
authors = [
1313
{name = "Cory Benfield", email = "[email protected]"}

0 commit comments

Comments
 (0)