Skip to content

Commit

Permalink
Merge branch 'master' into Dreamsorcerer-patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Nov 20, 2022
2 parents bfbb61c + c0a7666 commit c3d53a2
Show file tree
Hide file tree
Showing 69 changed files with 1,701 additions and 1,029 deletions.
66 changes: 51 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
COLOR: yes
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it
MYPY_FORCE_COLOR: 1
PY_COLORS: 1

jobs:

Expand All @@ -29,10 +34,10 @@ jobs:
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python 3.8
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Cache PyPI
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -121,6 +126,7 @@ jobs:
pyver: [3.7, 3.8, 3.9, '3.10']
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
experimental: [false]
exclude:
- os: macos
no-extensions: 'Y'
Expand All @@ -130,14 +136,20 @@ jobs:
pyver: 3.8
- os: windows
no-extensions: 'Y'
# pypy 3.7 exists in beta and doesn't work well yet
# include:
# - pyver: pypy3
# no-extensions: 'Y'
# os: ubuntu
experimental: [false]
include:
- pyver: pypy-3.8
no-extensions: 'Y'
os: ubuntu
experimental: false
- os: macos
pyver: "3.11.0-alpha - 3.11.0"
experimental: true
no-extensions: 'Y'
- os: ubuntu
pyver: "3.11.0-alpha - 3.11.0"
experimental: false
no-extensions: 'Y'
- os: windows
pyver: "3.11.0-alpha - 3.11.0"
experimental: true
no-extensions: 'Y'
Expand All @@ -150,6 +162,7 @@ jobs:
with:
submodules: true
- name: Setup Python ${{ matrix.pyver }}
id: python-install
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyver }}
Expand Down Expand Up @@ -182,18 +195,39 @@ jobs:
path: vendor/llhttp/build/
- name: Run unittests
env:
COLOR: 'yes'
COLOR: yes
AIOHTTP_NO_EXTENSIONS: ${{ matrix.no-extensions }}
PIP_USER: 1
run: >-
PATH="${HOME}/Library/Python/3.11/bin:${HOME}/.local/bin:${PATH}"
make test
shell: bash
- name: Re-run the failing tests with maximum verbosity
if: failure()
env:
COLOR: yes
AIOHTTP_NO_EXTENSIONS: ${{ matrix.no-extensions }}
run: >- # `exit 1` makes sure that the job remains red with flaky runs
pytest --no-cov -vvvvv --lf && exit 1
shell: bash
- name: Turn coverage into xml
env:
COLOR: 'yes'
PIP_USER: 1
run: |
make vvtest
python -m coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unit
fail_ci_if_error: false
flags: >-
CI-GHA,OS-${{
runner.os
}},VM-${{
matrix.os
}},Py-${{
steps.python-install.outputs.python-version
}}
check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down Expand Up @@ -292,6 +326,8 @@ jobs:
shell: bash
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
Expand All @@ -307,7 +343,7 @@ jobs:
run: |
make cythonize
- name: Build wheels
uses: pypa/cibuildwheel@2.7.0
uses: pypa/cibuildwheel@v2.10.1
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
- uses: actions/upload-artifact@v3
Expand All @@ -331,7 +367,7 @@ jobs:
- name: Login
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Download disctributions
- name: Download distributions
uses: actions/download-artifact@v3
with:
name: dist
Expand All @@ -340,7 +376,7 @@ jobs:
run: |
tree dist
- name: Make Release
uses: aio-libs/create-release@v1.4.0
uses: aio-libs/create-release@v1.6.6
with:
changes_file: CHANGES.rst
name: aiohttp
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ repos:
hooks:
- id: check-merge-conflict
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/PyCQA/isort
rev: '5.10.1'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '22.3.0'
rev: '22.10.0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python
Expand Down Expand Up @@ -72,12 +72,12 @@ repos:
- id: detect-private-key
exclude: ^examples/
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.34.0'
rev: 'v3.2.2'
hooks:
- id: pyupgrade
args: ['--py36-plus']
- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
rev: '5.0.4'
hooks:
- id: flake8
additional_dependencies:
Expand Down
83 changes: 83 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,89 @@

.. towncrier release notes start
3.8.3 (2022-09-21)
==================

.. attention::

This is the last :doc:`aiohttp <index>` release tested under
Python 3.6. The 3.9 stream is dropping it from the CI and the
distribution package metadata.

Bugfixes
--------

- Increased the upper boundary of the :doc:`multidict:index` dependency
to allow for the version 6 -- by :user:`hugovk`.

It used to be limited below version 7 in :doc:`aiohttp <index>` v3.8.1 but
was lowered in v3.8.2 via :pr:`6550` and never brought back, causing
problems with dependency pins when upgrading. :doc:`aiohttp <index>` v3.8.3
fixes that by recovering the original boundary of ``< 7``.
`#6950 <https://github.com/aio-libs/aiohttp/issues/6950>`_


----


3.8.2 (2022-09-20, subsequently yanked on 2022-09-21)
=====================================================

Bugfixes
--------

- Support registering OPTIONS HTTP method handlers via RouteTableDef.
`#4663 <https://github.com/aio-libs/aiohttp/issues/4663>`_
- Started supporting ``authority-form`` and ``absolute-form`` URLs on the server-side.
`#6227 <https://github.com/aio-libs/aiohttp/issues/6227>`_
- Fix Python 3.11 alpha incompatibilities by using Cython 0.29.25
`#6396 <https://github.com/aio-libs/aiohttp/issues/6396>`_
- Remove a deprecated usage of pytest.warns(None)
`#6663 <https://github.com/aio-libs/aiohttp/issues/6663>`_
- Fix regression where ``asyncio.CancelledError`` occurs on client disconnection.
`#6719 <https://github.com/aio-libs/aiohttp/issues/6719>`_
- Export :py:class:`~aiohttp.web.PrefixedSubAppResource` under
:py:mod:`aiohttp.web` -- by :user:`Dreamsorcerer`.

This fixes a regression introduced by :pr:`3469`.
`#6889 <https://github.com/aio-libs/aiohttp/issues/6889>`_
- Dropped the :class:`object` type possibility from
the :py:attr:`aiohttp.ClientSession.timeout`
property return type declaration.
`#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
`#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_


Improved Documentation
----------------------

- Added clarification on configuring the app object with settings such as a db connection.
`#4137 <https://github.com/aio-libs/aiohttp/issues/4137>`_
- Edited the web.run_app declaration.
`#6401 <https://github.com/aio-libs/aiohttp/issues/6401>`_
- Dropped the :class:`object` type possibility from
the :py:attr:`aiohttp.ClientSession.timeout`
property return type declaration.
`#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
`#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_


Deprecations and Removals
-------------------------

- Drop Python 3.5 support, aiohttp works on 3.6+ now.
`#4046 <https://github.com/aio-libs/aiohttp/issues/4046>`_


Misc
----

- `#6369 <https://github.com/aio-libs/aiohttp/issues/6369>`_, `#6399 <https://github.com/aio-libs/aiohttp/issues/6399>`_, `#6550 <https://github.com/aio-libs/aiohttp/issues/6550>`_, `#6708 <https://github.com/aio-libs/aiohttp/issues/6708>`_, `#6757 <https://github.com/aio-libs/aiohttp/issues/6757>`_, `#6857 <https://github.com/aio-libs/aiohttp/issues/6857>`_, `#6872 <https://github.com/aio-libs/aiohttp/issues/6872>`_


----


3.8.1 (2021-11-14)
==================

Expand Down
1 change: 0 additions & 1 deletion CHANGES/4046.removal

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/4137.doc

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/4663.bugfix

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/6227.bugfix

This file was deleted.

3 changes: 0 additions & 3 deletions CHANGES/6369.misc

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES/6378.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dropped Python 3.6 support.
1 change: 0 additions & 1 deletion CHANGES/6399.misc

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/6401.doc

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/6663.bugfix

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES/6701.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``readuntil`` to work with a delimiter of more than one character
1 change: 0 additions & 1 deletion CHANGES/6708.misc

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/6719.bugfix

This file was deleted.

2 changes: 0 additions & 2 deletions CHANGES/6857.misc

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/6872.misc

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES/6907.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated Redis code examples from the document to follow the latest API.
1 change: 1 addition & 0 deletions CHANGES/6979.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve grammar and brevity in communication in the Policy for Backward Incompatible Changes section of ``docs/index.rst`` -- :user:`Paarth`.
1 change: 1 addition & 0 deletions CHANGES/6998.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added documentation on client authentication and updating headers. -- by :user:`faph`
1 change: 1 addition & 0 deletions CHANGES/7014.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed bug when using ``TCPConnector`` with ``ttl_dns_cache=0``.
1 change: 1 addition & 0 deletions CHANGES/7025.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix response returned from expect handler being thrown away. -- by :user:`Dreamsorcerer`
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Illia Volochii
Ilya Chichak
Ilya Gruzinov
Ingmar Steen
Ivan Lakovic
Ivan Larin
Jacob Champion
Jaesung Lee
Expand Down Expand Up @@ -221,6 +222,7 @@ Mathieu Dugré
Matt VanEseltine
Matthieu Hauglustaine
Matthieu Rigal
Matvey Tingaev
Meet Mangukiya
Michael Ihnatenko
Michał Górny
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ test: .develop
.PHONY: vtest
vtest: .develop
@pytest -s -v
@python -X dev -m pytest -s -v -m dev_mode
@python -X dev -m pytest --cov-append -s -v -m dev_mode

.PHONY: vvtest
vvtest: .develop
@pytest -vv
@python -X dev -m pytest -s -vv -m dev_mode
@python -X dev -m pytest --cov-append -s -vv -m dev_mode

.PHONY: cov-dev
cov-dev: .develop
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To get something from the web:
html = await response.text()
print("Body:", html[:15], "...")
asyncio.run(main())
asyncio.run(main())
This prints:

Expand Down Expand Up @@ -166,13 +166,15 @@ Requirements
- charset-normalizer_
- multidict_
- yarl_
- frozenlist_

Optionally you may install the cChardet_ and aiodns_ libraries (highly
recommended for sake of speed).

.. _charset-normalizer: https://pypi.org/project/charset-normalizer
.. _aiodns: https://pypi.python.org/pypi/aiodns
.. _multidict: https://pypi.python.org/pypi/multidict
.. _frozenlist: https://pypi.org/project/frozenlist/
.. _yarl: https://pypi.python.org/pypi/yarl
.. _async-timeout: https://pypi.python.org/pypi/async_timeout
.. _cChardet: https://pypi.python.org/pypi/cchardet
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.0.0a1"
__version__ = "4.0.0a2.dev0"

from typing import Tuple

Expand Down
4 changes: 3 additions & 1 deletion aiohttp/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def handler(self) -> Callable[[Request], Awaitable[StreamResponse]]:

@property
@abstractmethod
def expect_handler(self) -> Callable[[Request], Awaitable[None]]:
def expect_handler(
self,
) -> Callable[[Request], Awaitable[Optional[StreamResponse]]]:
"""Expect handler for 100-continue processing"""

@property # pragma: no branch
Expand Down
Loading

0 comments on commit c3d53a2

Please sign in to comment.