Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/pip/mypy-1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Feb 6, 2025
2 parents c42996f + e6ed541 commit 809ebd0
Show file tree
Hide file tree
Showing 14 changed files with 266 additions and 25 deletions.
44 changes: 31 additions & 13 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python 3.13
- name: Setup Python 3.13.2
id: python-install
uses: actions/setup-python@v5
with:
python-version: 3.13
python-version: 3.13.2
cache: pip
cache-dependency-path: requirements/*.txt
- name: Update pip, wheel, setuptools, build, twine
Expand Down Expand Up @@ -364,23 +364,35 @@ jobs:
permissions:
contents: read # to fetch code (actions/checkout)

name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }}
runs-on: ${{ matrix.os }}-latest
name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }} ${{ matrix.musl }}
runs-on: ${{ matrix.os }}
needs: pre-deploy
strategy:
matrix:
os: [ubuntu, windows, macos]
os: ["ubuntu-latest", "windows-latest", "macos-latest", "ubuntu-24.04-arm"]
qemu: ['']
musl: [""]
include:
# Split ubuntu job for the sake of speed-up
- os: ubuntu
qemu: aarch64
- os: ubuntu
# Split ubuntu/musl jobs for the sake of speed-up
- os: ubuntu-latest
qemu: ppc64le
- os: ubuntu
qemu: riscv64
- os: ubuntu
musl: ""
- os: ubuntu-latest
qemu: ppc64le
musl: musllinux
- os: ubuntu-latest
qemu: s390x
musl: ""
- os: ubuntu-latest
qemu: s390x
musl: musllinux
- os: ubuntu-latest
qemu: armv7l
musl: musllinux
- os: ubuntu-latest
musl: musllinux
- os: ubuntu-24.04-arm
musl: musllinux
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -391,6 +403,10 @@ jobs:
uses: docker/setup-qemu-action@v3
with:
platforms: all
# This should be temporary
# xref https://github.com/docker/setup-qemu-action/issues/188
# xref https://github.com/tonistiigi/binfmt/issues/215
image: tonistiigi/binfmt:qemu-v8.1.5
id: qemu
- name: Prepare emulation
run: |
Expand Down Expand Up @@ -422,12 +438,13 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: pp* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: >-
dist-${{ matrix.os }}-${{
dist-${{ matrix.os }}-${{ matrix.musl }}-${{
matrix.qemu
&& matrix.qemu
|| 'native'
Expand Down Expand Up @@ -460,6 +477,7 @@ jobs:
with:
path: dist
pattern: dist-*
merge-multiple: true
- name: Collected dists
run: |
tree dist
Expand Down
107 changes: 107 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,113 @@

.. towncrier release notes start
3.11.12 (2025-02-05)
====================

Bug fixes
---------

- ``MultipartForm.decode()`` now follows RFC1341 7.2.1 with a ``CRLF`` after the boundary
-- by :user:`imnotjames`.


*Related issues and pull requests on GitHub:*
:issue:`10270`.



- Restored the missing ``total_bytes`` attribute to ``EmptyStreamReader`` -- by :user:`bdraco`.


*Related issues and pull requests on GitHub:*
:issue:`10387`.




Features
--------

- Updated :py:func:`~aiohttp.request` to make it accept ``_RequestOptions`` kwargs.
-- by :user:`Cycloctane`.


*Related issues and pull requests on GitHub:*
:issue:`10300`.



- Improved logging of HTTP protocol errors to include the remote address -- by :user:`bdraco`.


*Related issues and pull requests on GitHub:*
:issue:`10332`.




Improved documentation
----------------------

- Added ``aiohttp-openmetrics`` to list of third-party libraries -- by :user:`jelmer`.


*Related issues and pull requests on GitHub:*
:issue:`10304`.




Packaging updates and notes for downstreams
-------------------------------------------

- Added missing files to the source distribution to fix ``Makefile`` targets.
Added a ``cythonize-nodeps`` target to run Cython without invoking pip to install dependencies.


*Related issues and pull requests on GitHub:*
:issue:`10366`.



- Started building armv7l musllinux wheels -- by :user:`bdraco`.


*Related issues and pull requests on GitHub:*
:issue:`10404`.




Contributor-facing changes
--------------------------

- The CI/CD workflow has been updated to use `upload-artifact` v4 and `download-artifact` v4 GitHub Actions -- by :user:`silamon`.


*Related issues and pull requests on GitHub:*
:issue:`10281`.




Miscellaneous internal changes
------------------------------

- Restored support for zero copy writes when using Python 3.12 versions 3.12.9 and later or Python 3.13.2+ -- by :user:`bdraco`.

Zero copy writes were previously disabled due to :cve:`2024-12254` which is resolved in these Python versions.


*Related issues and pull requests on GitHub:*
:issue:`10137`.




----


3.11.11 (2024-12-18)
====================

Expand Down
2 changes: 0 additions & 2 deletions CHANGES/10270.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/10281.contrib.rst

This file was deleted.

2 changes: 0 additions & 2 deletions CHANGES/10300.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/10304.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/10330.packaging.rst

This file was deleted.

1 change: 0 additions & 1 deletion CHANGES/10332.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions CHANGES/10366.packaging

This file was deleted.

17 changes: 16 additions & 1 deletion aiohttp/http_writer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Http related parsers and protocol."""

import asyncio
import sys
import zlib
from typing import ( # noqa
Any,
Expand All @@ -24,6 +25,17 @@
__all__ = ("StreamWriter", "HttpVersion", "HttpVersion10", "HttpVersion11")


MIN_PAYLOAD_FOR_WRITELINES = 2048
IS_PY313_BEFORE_313_2 = (3, 13, 0) <= sys.version_info < (3, 13, 2)
IS_PY_BEFORE_312_9 = sys.version_info < (3, 12, 9)
SKIP_WRITELINES = IS_PY313_BEFORE_313_2 or IS_PY_BEFORE_312_9
# writelines is not safe for use
# on Python 3.12+ until 3.12.9
# on Python 3.13+ until 3.13.2
# and on older versions it not any faster than write
# CVE-2024-12254: https://github.com/python/cpython/pull/127656


class HttpVersion(NamedTuple):
major: int
minor: int
Expand Down Expand Up @@ -90,7 +102,10 @@ def _writelines(self, chunks: Iterable[bytes]) -> None:
transport = self._protocol.transport
if transport is None or transport.is_closing():
raise ClientConnectionResetError("Cannot write to closing transport")
transport.write(b"".join(chunks))
if SKIP_WRITELINES or size < MIN_PAYLOAD_FOR_WRITELINES:
transport.write(b"".join(chunks))
else:
transport.writelines(chunks)

async def write(
self,
Expand Down
1 change: 1 addition & 0 deletions aiohttp/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ class EmptyStreamReader(StreamReader): # lgtm [py/missing-call-to-init]

def __init__(self) -> None:
self._read_eof_chunk = False
self.total_bytes = 0

def __repr__(self) -> str:
return "<%s>" % self.__class__.__name__
Expand Down
2 changes: 2 additions & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ app’s
apps
arg
args
armv
Arsenic
async
asyncio
Expand Down Expand Up @@ -201,6 +202,7 @@ multidicts
Multidicts
multipart
Multipart
musllinux
mypy
Nagle
Nagle’s
Expand Down
Loading

0 comments on commit 809ebd0

Please sign in to comment.