Skip to content

Commit

Permalink
Merge branch 'master' into improve-cparser-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer committed Jul 18, 2023
2 parents 4b4a173 + 41e2c4c commit 7a5b940
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGES/7365.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added typing information to ``RawResponseMessage`` -- by :user:`Gobot1234`
25 changes: 10 additions & 15 deletions aiohttp/http_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import abc
import asyncio
import collections
import re
import string
from contextlib import suppress
Expand Down Expand Up @@ -76,20 +75,16 @@ class RawRequestMessage(NamedTuple):
url: URL


RawResponseMessage = collections.namedtuple(
"RawResponseMessage",
[
"version",
"code",
"reason",
"headers",
"raw_headers",
"should_close",
"compression",
"upgrade",
"chunked",
],
)
class RawResponseMessage(NamedTuple):
version: HttpVersion
code: int
reason: str
headers: CIMultiDictProxy[str]
raw_headers: RawHeaders
should_close: bool
compression: Optional[str]
upgrade: bool
chunked: bool


_MsgT = TypeVar("_MsgT", RawRequestMessage, RawResponseMessage)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None:
if not isinstance(value, AsyncIterable):
raise TypeError(
"value argument must support "
"collections.abc.AsyncIterablebe interface, "
"collections.abc.AsyncIterable interface, "
"got {!r}".format(type(value))
)

Expand Down
2 changes: 2 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Install pre-commit hooks:

Congratulations, you are ready to run the test suite!

.. include:: ../vendor/README.rst


Run autoformatter
-----------------
Expand Down
3 changes: 0 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ Please feel free to file an issue on the `bug tracker
<https://github.com/aio-libs/aiohttp/issues>`_ if you have found a bug
or have some suggestion in order to improve the library.

The library uses `Azure Pipelines <https://dev.azure.com/aio-libs/aiohttp/_build>`_ for
Continuous Integration.


Dependencies
============
Expand Down
14 changes: 9 additions & 5 deletions vendor/README.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
LLHTTP
======
------

To build the llhttp parser, first get/update the submodule:
When building aiohttp from source, there is a pure Python parser used by default.
For better performance, you may want to build the higher performance C parser.

To build this ``llhttp`` parser, first get/update the submodules (to update to a
newer release, add ``--remote`` and check the branch in ``.gitmodules``)::

git submodule update --init --recursive

Then build llhttp:
Then build ``llhttp``::

cd vendor/llhttp/
npm install
make

Then build our parser:
Then build our parser::

cd -
make cythonize

Then you can build or install it with ``python -m build`` or ``pip install .``
Then you can build or install it with ``python -m build`` or ``pip install -e .``

0 comments on commit 7a5b940

Please sign in to comment.