Skip to content

Commit 459ead9

Browse files
authored
Merge pull request #1 from KRRT7/master
unblock upstream PR
2 parents a248458 + 01308ee commit 459ead9

File tree

7 files changed

+55
-59
lines changed

7 files changed

+55
-59
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ jobs:
3737
mkdir -p dist/
3838
echo "${VERSION}" > dist/VERSION
3939
40-
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
40+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
4141
with:
42-
name: dist
42+
name: dist-version
4343
path: dist/
4444

4545
build-sdist:
4646
needs: validate-release-request
4747
runs-on: ubuntu-latest
4848

4949
steps:
50-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
50+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
5151
with:
5252
fetch-depth: 50
5353
submodules: true
5454

5555
- name: Set up Python
56-
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
56+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
5757

5858
- name: Build source distribution
5959
run: |
6060
python -m pip install -U setuptools wheel pip
6161
python setup.py sdist
6262
63-
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
63+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
6464
with:
65-
name: dist
65+
name: dist-sdist
6666
path: dist/*.tar.*
6767

6868
build-wheels:
@@ -73,19 +73,17 @@ jobs:
7373
os: [ubuntu-latest, macos-latest, windows-latest]
7474
cibw_arch: ["auto64", "aarch64", "universal2"]
7575
cibw_python:
76-
- "cp38-*"
77-
- "cp39-*"
78-
- "cp310-*"
79-
- "cp311-*"
80-
- "cp312-*"
76+
- "cp38"
77+
- "cp39"
78+
- "cp310"
79+
- "cp311"
80+
- "cp312"
81+
- "cp313"
8182
exclude:
8283
- os: ubuntu-latest
8384
cibw_arch: universal2
8485
- os: macos-latest
8586
cibw_arch: aarch64
86-
- os: macos-latest
87-
cibw_python: "cp37-*"
88-
cibw_arch: universal2
8987
- os: windows-latest
9088
cibw_arch: universal2
9189
- os: windows-latest
@@ -99,45 +97,46 @@ jobs:
9997
PIP_DISABLE_PIP_VERSION_CHECK: 1
10098

10199
steps:
102-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
100+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
103101
with:
104102
fetch-depth: 50
105103
submodules: true
106104

107105
- name: Set up QEMU
108106
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64'
109-
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
107+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
110108
with:
111109
platforms: arm64
112110

113-
- uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # v2.16.2
111+
- uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
114112
env:
115113
CIBW_BUILD_VERBOSITY: 1
116-
CIBW_BUILD: ${{ matrix.cibw_python }}
114+
CIBW_BUILD: ${{ matrix.cibw_python }}-*
117115
CIBW_ARCHS: ${{ matrix.cibw_arch }}
118116
CIBW_TEST_EXTRAS: "test"
119117
CIBW_TEST_COMMAND: "python {project}/tests/__init__.py"
120118
CIBW_TEST_COMMAND_WINDOWS: "python {project}\\tests\\__init__.py"
121119
CIBW_TEST_SKIP: "*universal2:arm64"
122120

123-
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
121+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
124122
with:
125-
name: dist
123+
name: dist-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ matrix.cibw_python }}
126124
path: wheelhouse/*.whl
127125

128126
publish:
129127
needs: [build-sdist, build-wheels]
130128
runs-on: ubuntu-latest
131129

132130
steps:
133-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
131+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
134132
with:
135133
fetch-depth: 5
136134
submodules: false
137135

138-
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
136+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
139137
with:
140-
name: dist
138+
pattern: dist-*
139+
merge-multiple: true
141140
path: dist/
142141

143142
- name: Extract Release Version
@@ -171,7 +170,7 @@ jobs:
171170
ls -al dist/
172171
173172
- name: Upload to PyPI
174-
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
173+
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
175174
with:
176175
user: __token__
177176
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1818
os: [windows-latest, ubuntu-latest, macos-latest]
1919

2020
env:
2121
PIP_DISABLE_PIP_VERSION_CHECK: 1
2222

2323
steps:
24-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
24+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2525
with:
2626
fetch-depth: 50
2727
submodules: true
@@ -37,7 +37,7 @@ jobs:
3737
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
3838
3939
- name: Set up Python ${{ matrix.python-version }}
40-
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
40+
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
4141
if: steps.release.outputs.version == 0
4242
with:
4343
python-version: ${{ matrix.python-version }}

httptools/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
# supported platforms, publish the packages on PyPI, merge the PR
1111
# to the target branch, create a Git tag pointing to the commit.
1212

13-
__version__ = '0.6.1'
13+
__version__ = '0.6.2'

httptools/parser/parser.pyi

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from typing import Union, Any
2-
from array import array
2+
from array import array
33
from .protocol import HTTPProtocol
44

5-
6-
75
class HttpParser:
8-
def __init__(self, protocol:Union[HTTPProtocol, Any]) -> None:
6+
def __init__(self, protocol: Union[HTTPProtocol, Any]) -> None:
97
"""
108
protocol -- a Python object with the following methods
119
(all optional):
@@ -24,15 +22,18 @@ class HttpParser:
2422
def get_http_version(self) -> str:
2523
"""Return an HTTP protocol version."""
2624
...
25+
2726
def should_keep_alive(self) -> bool:
2827
"""Return ``True`` if keep-alive mode is preferred."""
2928
...
29+
3030
def should_upgrade(self) -> bool:
3131
"""Return ``True`` if the parsed request is a valid Upgrade request.
32-
The method exposes a flag set just before on_headers_complete.
33-
Calling this method earlier will only yield `False`."""
32+
The method exposes a flag set just before on_headers_complete.
33+
Calling this method earlier will only yield `False`."""
3434
...
35-
def feed_data(self, data:Union[bytes, bytearray, memoryview, array]) -> None:
35+
36+
def feed_data(self, data: Union[bytes, bytearray, memoryview, array]) -> None:
3637
"""Feed data to the parser.
3738
3839
Will eventually trigger callbacks on the ``protocol``
@@ -43,14 +44,12 @@ class HttpParser:
4344
set to the offset of the non-HTTP data in ``data``.
4445
"""
4546

46-
4747
class HttpRequestParser(HttpParser):
4848
"""Used for parsing http requests from the server's side"""
49-
49+
5050
def get_method(self) -> bytes:
5151
"""Return HTTP request method (GET, HEAD, etc)"""
5252

53-
5453
class HttpResponseParser(HttpParser):
5554
"""Used for parsing http requests from the client's side"""
5655

httptools/parser/protocol.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from typing import Protocol
22

3+
34
class HTTPProtocol(Protocol):
45
"""Used for providing static type-checking when parsing through the http protocol"""
56

6-
def on_message_begin() -> None:...
7-
def on_url(url: bytes) -> None:...
8-
def on_header(name: bytes, value: bytes) -> None:...
9-
def on_headers_complete() -> None:...
10-
def on_body(body: bytes) -> None:...
11-
def on_message_complete() -> None:...
12-
def on_chunk_header() -> None:...
13-
def on_chunk_complete() -> None:...
14-
def on_status(status: bytes) -> None:...
15-
7+
def on_message_begin() -> None: ...
8+
def on_url(url: bytes) -> None: ...
9+
def on_header(name: bytes, value: bytes) -> None: ...
10+
def on_headers_complete() -> None: ...
11+
def on_body(body: bytes) -> None: ...
12+
def on_message_complete() -> None: ...
13+
def on_chunk_header() -> None: ...
14+
def on_chunk_complete() -> None: ...
15+
def on_status(status: bytes) -> None: ...

httptools/parser/url_parser.pyi

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ from typing import Union
22
from array import array
33

44
class URL:
5-
schema:bytes
6-
host:bytes
7-
port:int
8-
path:bytes
9-
query:bytes
10-
fragment:bytes
11-
userinfo:bytes
5+
schema: bytes
6+
host: bytes
7+
port: int
8+
path: bytes
9+
query: bytes
10+
fragment: bytes
11+
userinfo: bytes
1212

13-
def parse_url(url:Union[bytes, bytearray, memoryview, array]) -> URL:
13+
def parse_url(url: Union[bytes, bytearray, memoryview, array]) -> URL:
1414
"""Parse URL strings into a structured Python object.
1515
1616
Returns an instance of ``httptools.URL`` class with the
@@ -25,5 +25,3 @@ def parse_url(url:Union[bytes, bytearray, memoryview, array]) -> URL:
2525
- userinfo: bytes
2626
"""
2727
...
28-
29-

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
ROOT = pathlib.Path(__file__).parent
1717

18-
CYTHON_DEPENDENCY = 'Cython(>=0.29.24,<0.30.0)'
18+
CYTHON_DEPENDENCY = 'Cython>=0.29.24'
1919

2020

2121
class httptools_build_ext(build_ext):

0 commit comments

Comments
 (0)