Skip to content

Commit

Permalink
Merge branch 'master' into Dreamsorcerer/master
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 26, 2021
2 parents 8cb4b6f + 58f86f5 commit 0a39f92
Show file tree
Hide file tree
Showing 119 changed files with 1,277 additions and 914 deletions.
20 changes: 0 additions & 20 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,3 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 10

# Maintain dependencies for GitHub Actions aiohttp 3.8
- package-ecosystem: "github-actions"
directory: "/"
labels:
- dependencies
target-branch: "3.8"
schedule:
interval: "daily"
open-pull-requests-limit: 10

# Maintain dependencies for Python aiohttp 3.8
- package-ecosystem: "pip"
directory: "/"
labels:
- dependencies
target-branch: "3.8"
schedule:
interval: "daily"
open-pull-requests-limit: 10
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
needs: lint
strategy:
matrix:
pyver: [3.7, 3.8, 3.9]
pyver: [3.7, 3.8, 3.9, '3.10']
no-extensions: ['', 'Y']
os: [ubuntu, macos, windows]
exclude:
Expand Down Expand Up @@ -116,6 +116,8 @@ jobs:
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-
- name: Upgrade wheel # Needed for proxy.py install not to explode
run: pip install -U wheel
- name: Cythonize
if: ${{ matrix.no-extensions == '' }}
run: |
Expand Down Expand Up @@ -174,7 +176,7 @@ jobs:
name: Linux
strategy:
matrix:
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39]
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
arch: [x86_64, aarch64, i686, ppc64le, s390x]
fail-fast: false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -222,7 +224,7 @@ jobs:
name: Binary wheels
strategy:
matrix:
pyver: [3.7, 3.8, 3.9]
pyver: [3.7, 3.8, 3.9, '3.10']
os: [macos, windows]
arch: [x86, x64]
exclude:
Expand Down
4 changes: 3 additions & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[mypy]
files = aiohttp, examples, tests
check_untyped_defs = True
exclude = examples/legacy/
follow_imports_for_stubs = True
#disallow_any_decorated = True
disallow_any_generics = True
Expand Down Expand Up @@ -41,3 +40,6 @@ ignore_missing_imports = True

[mypy-uvloop]
ignore_missing_imports = True

[mypy-python_on_whales]
ignore_missing_imports = True
25 changes: 10 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ repos:
entry: ./tools/check_changes.py
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
rev: 'v4.0.1'
hooks:
- id: check-merge-conflict
- repo: https://github.com/asottile/yesqa
rev: v1.2.2
rev: v1.3.0
hooks:
- id: yesqa
- repo: https://github.com/pre-commit/mirrors-isort
rev: 'v5.6.4'
- repo: https://github.com/PyCQA/isort
rev: '5.9.3'
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '20.8b1'
rev: '21.9b0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.3.0'
rev: 'v4.0.1'
hooks:
- id: end-of-file-fixer
exclude: >-
Expand All @@ -44,34 +44,29 @@ repos:
- id: check-xml
- id: check-executables-have-shebangs
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: check-added-large-files
- id: check-symlinks
- id: debug-statements
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ['--remove']
- id: check-executables-have-shebangs
- id: check-case-conflict
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
exclude: ^examples/
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.7.4'
rev: 'v2.29.0'
hooks:
- id: pyupgrade
args: ['--py36-plus']
- repo: https://gitlab.com/pycqa/flake8
rev: '3.8.4'
- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
hooks:
- id: flake8
exclude: "^docs/"

- repo: git://github.com/Lucas-C/pre-commit-hooks-markup
rev: v1.0.0
rev: v1.0.1
hooks:
- id: rst-linter
files: >-
Expand Down
20 changes: 18 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html
# for details

---
version: 2

submodules:
include: all # []
exclude: []
recursive: true

build:
image: latest
python:
version: 3.6
pip_install: false
version: 3.8
install:
- method: pip
path: .
- requirements: requirements/doc.txt
...
4 changes: 0 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
=========
Changelog
=========

..
You should *NOT* be adding new change log entries to this file, this
file is managed by towncrier. You *may* edit previous change logs to
Expand Down
2 changes: 1 addition & 1 deletion CHANGES/3559.doc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Clarified WebSocketResponse closure in quickstart example.
Clarified ``WebSocketResponse`` closure in the quick start example.
4 changes: 2 additions & 2 deletions CHANGES/3828.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp
cannot be compiled with C Accellerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly
Disabled implicit switch-back to pure python mode. The build fails loudly if aiohttp
cannot be compiled with C Accelerators. Use `AIOHTTP_NO_EXTENSIONS=1` to explicitly
disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python
mode is significantly slower than compiled one.
2 changes: 1 addition & 1 deletion CHANGES/4054.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Implemented readuntil in StreamResponse
Implemented ``readuntil`` in ``StreamResponse``
1 change: 1 addition & 0 deletions CHANGES/4247.1.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Automated running autobahn test suite by integrating with pytest.
2 changes: 1 addition & 1 deletion CHANGES/4277.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add set_cookie and del_cookie methods to HTTPException
Added ``set_cookie`` and ``del_cookie`` methods to ``HTTPException``
2 changes: 1 addition & 1 deletion CHANGES/4299.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Delete older code in example (examples/web_classview.py)
Delete older code in example (:file:`examples/web_classview.py`)
2 changes: 1 addition & 1 deletion CHANGES/4302.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fixed the support of route handlers wrapped by functools.partial()
Fixed the support of route handlers wrapped by :py:func:`functools.partial`
2 changes: 1 addition & 1 deletion CHANGES/4452.doc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix typo in client_quickstart docs.
Fixed a typo in the ``client_quickstart`` doc.
8 changes: 4 additions & 4 deletions CHANGES/4700.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AioHTTPTestCase is more async friendly now.
``AioHTTPTestCase`` is more async friendly now.

For people who use unittest and are used to use unittest.TestCase
it will be easier to write new test cases like the sync version of the TestCase class,
For people who use unittest and are used to use :py:exc:`~unittest.TestCase`
it will be easier to write new test cases like the sync version of the :py:exc:`~unittest.TestCase` class,
without using the decorator `@unittest_run_loop`, just `async def test_*`.
The only difference is that for the people using python3.7 and below a new dependency is needed, it is `asynctestcase`.
The only difference is that for the people using python3.7 and below a new dependency is needed, it is ``asynctestcase``.
2 changes: 1 addition & 1 deletion CHANGES/5326.doc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Refactor OpenAPI/Swagger aiohttp addons, added aio-openapi
Refactored OpenAPI/Swagger aiohttp addons, added ``aio-openapi``
1 change: 1 addition & 0 deletions CHANGES/5392.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set "text/plain" when data is an empty string in client requests.
4 changes: 4 additions & 0 deletions CHANGES/5571.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Don't send secure cookies by insecure transports.

By default, the transport is secure if https or wss scheme is used.
Use `CookieJar(treat_as_secure_origin="http://127.0.0.1")` to override the default security checker.
1 change: 1 addition & 0 deletions CHANGES/5625.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove (broken) legacy examples.
1 change: 1 addition & 0 deletions CHANGES/5634.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A warning was added, when a cookie's length exceeds the :rfc:`6265` minimum client support -- :user:`anesabml`.
2 changes: 1 addition & 1 deletion CHANGES/5783.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Started keeping the ``Authorization`` header during http->https redirects when the host remains the same.
Started keeping the ``Authorization`` header during HTTP -> HTTPS redirects when the host remains the same.
1 change: 1 addition & 0 deletions CHANGES/5840.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove external test dependency to http://httpbin.org
1 change: 1 addition & 0 deletions CHANGES/5853.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't cancel current task when entering a cancelled timer.
1 change: 1 addition & 0 deletions CHANGES/5898.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a middleware type alias ``aiohttp.typedefs.Middleware``.
4 changes: 4 additions & 0 deletions CHANGES/5901.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix the error in handling the return value of `getaddrinfo`.
`getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
It will cause a index out of range error in aiohttp. For example, if user compile CPython with
`--disable-ipv6` option but his system enable the ipv6.
2 changes: 1 addition & 1 deletion CHANGES/5905.bugfix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
remove deprecated loop argument for asnycio.sleep/gather calls
Removed the deprecated ``loop`` argument from the ``asyncio.sleep``/``gather`` calls
1 change: 1 addition & 0 deletions CHANGES/5909.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add compression strategy parameter to enable_compression method.
1 change: 1 addition & 0 deletions CHANGES/5914.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed the SVG logos to be more optimized and the viewbox to 0 0 24 24, while keeping the same height and width -- :user:`ShadiestGoat`.
1 change: 1 addition & 0 deletions CHANGES/5925.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Return ``None`` from ``request.if_modified_since``, ``request.if_unmodified_since``, ``request.if_range`` and ``response.last_modified`` when corresponding http date headers are invalid.
1 change: 1 addition & 0 deletions CHANGES/5927.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- :user:`Hanaasagi`.
1 change: 1 addition & 0 deletions CHANGES/5930.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Switched ``chardet`` to ``charset-normalizer`` for guessing the HTTP payload body encoding -- :user:`Ousret`.
1 change: 1 addition & 0 deletions CHANGES/5957.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added optional auto_decompress argument for HttpRequestParser
3 changes: 3 additions & 0 deletions CHANGES/5992.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added support for HTTPS proxies to the extent CPython's
:py:mod:`asyncio` supports it -- by :user:`bmbouter`,
:user:`jborean93` and :user:`webknjaz`.
2 changes: 2 additions & 0 deletions CHANGES/6002.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Implemented end-to-end testing of sending HTTP and HTTPS requests
via ``proxy.py``.
3 changes: 3 additions & 0 deletions CHANGES/6045.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added ``commit``, ``gh``, ``issue``, ``pr``
and ``user`` RST roles in Sphinx
-- :user:`webknjaz`.
1 change: 1 addition & 0 deletions CHANGES/6079.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Trove classifier and create binary wheels for 3.10. -- :user:`hugovk`.
95 changes: 95 additions & 0 deletions CHANGES/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.. _Adding change notes with your PRs:

Adding change notes with your PRs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It is very important to maintain a log for news of how
updating to the new version of the software will affect
end-users. This is why we enforce collection of the change
fragment files in pull requests as per `Towncrier philosophy`_.

The idea is that when somebody makes a change, they must record
the bits that would affect end-users only including information
that would be useful to them. Then, when the maintainers publish
a new release, they'll automatically use these records to compose
a change log for the respective version. It is important to
understand that including unnecessary low-level implementation
related details generates noise that is not particularly useful
to the end-users most of the time. And so such details should be
recorded in the Git history rather than a changelog.

Alright! So how to add a news fragment?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``aiohttp`` uses `towncrier <https://pypi.org/project/towncrier/>`_
for changelog management.
To submit a change note about your PR, add a text file into the
``CHANGES/`` folder. It should contain an
explanation of what applying this PR will change in the way
end-users interact with the project. One sentence is usually
enough but feel free to add as many details as you feel necessary
for the users to understand what it means.

**Use the past tense** for the text in your fragment because,
combined with others, it will be a part of the "news digest"
telling the readers **what changed** in a specific version of
the library *since the previous version*. You should also use
reStructuredText syntax for highlighting code (inline or block),
linking parts of the docs or external sites.
If you wish to sign your change, feel free to add ``-- by
:user:`github-username``` at the end (replace ``github-username``
with your own!).

Finally, name your file following the convention that Towncrier
understands: it should start with the number of an issue or a
PR followed by a dot, then add a patch type, like ``feature``,
``doc``, ``misc`` etc., and add ``.rst`` as a suffix. If you
need to add more than one fragment, you may add an optional
sequence number (delimited with another period) between the type
and the suffix.

In general the name will follow ``<pr_number>.<category>.rst`` pattern,
where the categories are:

- ``feature``: Any new feature
- ``bugfix``: A bug fix
- ``doc``: A change to the documentation
- ``misc``: Changes internal to the repo like CI, test and build changes
- ``removal``: For deprecations and removals of an existing feature or behavior

A pull request may have more than one of these components, for example
a code change may introduce a new feature that deprecates an old
feature, in which case two fragments should be added. It is not
necessary to make a separate documentation fragment for documentation
changes accompanying the relevant code changes.

Examples for adding changelog entries to your Pull Requests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File :file:`CHANGES/6045.doc.1.rst`:

.. code-block:: rst
Added a ``:user:`` role to Sphinx config -- by :user:`webknjaz`
File :file:`CHANGES/4431.bugfix.rst`:

.. code-block:: rst
Fixed HTTP client requests to honor ``no_proxy`` environment
variables -- by :user:`scirelli`
File :file:`CHANGES/4594.feature.rst`:

.. code-block:: rst
Added support for ``ETag`` to :py:class:`~aiohttp.web.FileResponse`
-- by :user:`greshilov`, :user:`serhiy-storchaka` and :user:`asvetlov`
.. tip::

See :file:`pyproject.toml` for all available categories
(``tool.towncrier.type``).

.. _Towncrier philosophy:
https://towncrier.readthedocs.io/en/actual-freaking-docs/#philosophy
Loading

0 comments on commit 0a39f92

Please sign in to comment.