Skip to content

[PR #10700/ceeca6a backport][3.12] Add support for switching the zlib implementation#10723

Merged
bdraco merged 2 commits intoaio-libs:3.12from
TimMenninger:switch-zlib-backend-3.12
Apr 14, 2025
Merged

[PR #10700/ceeca6a backport][3.12] Add support for switching the zlib implementation#10723
bdraco merged 2 commits intoaio-libs:3.12from
TimMenninger:switch-zlib-backend-3.12

Conversation

@TimMenninger
Copy link
Copy Markdown
Contributor

backport #10700 to 3.12

What do these changes do?

These changes allow a user to arbitrarily set the zlib backend by calling aiohttp.set_zlib_backend() on the zlib module of their choice. For example:

import aiohttp
import zlib_ng.zlib_ng as zlib_ng

aiohttp.set_zlib_backend(zlib_ng)

Are there changes in behavior for the user?

The only changes for the user are opt-in.

Is it a substantial burden for the maintainers to support this?

The only burden that could arise is if for some reason zlib_ng.zlib_ng or isal.isal_zlib change their interface to differ from zlib.

Related issue number

Fixes #9798

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

…o-libs#10700, aio-libs#9798)

Committed with conflicts resolved in subsequent commit:
Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   aiohttp/__init__.py
	both modified:   aiohttp/web_response.py
	both modified:   tests/test_client_functional.py
	both modified:   tests/test_client_request.py
	both modified:   tests/test_client_ws_functional.py
	both modified:   tests/test_http_writer.py
	both modified:   tests/test_multipart.py
	both modified:   tests/test_web_functional.py
	both modified:   tests/test_web_response.py
	both modified:   tests/test_web_sendfile_functional.py
	both modified:   tests/test_websocket_parser.py
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Apr 14, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 14, 2025

CodSpeed Performance Report

Merging #10723 will not alter performance

Comparing TimMenninger:switch-zlib-backend-3.12 (e5c554c) with 3.12 (eb1abe4)

Summary

✅ 51 untouched benchmarks

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 99.69789% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (3.12@abb3e87). Learn more about missing BASE report.

Files with missing lines Patch % Lines
tests/test_http_writer.py 99.42% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             3.12   #10723   +/-   ##
=======================================
  Coverage        ?   98.11%           
=======================================
  Files           ?      126           
  Lines           ?    37889           
  Branches        ?     2139           
=======================================
  Hits            ?    37175           
  Misses          ?      544           
  Partials        ?      170           
Flag Coverage Δ
CI-GHA 98.00% <99.39%> (?)
OS-Linux 97.70% <99.39%> (?)
OS-Windows 94.80% <99.09%> (?)
OS-macOS 96.83% <98.48%> (?)
Py-3.10.11 96.72% <98.79%> (?)
Py-3.10.16 97.24% <99.09%> (?)
Py-3.11.11 97.39% <99.09%> (?)
Py-3.11.9 96.83% <98.79%> (?)
Py-3.12.9 97.78% <98.79%> (?)
Py-3.13.2 97.77% <98.79%> (?)
Py-3.9.13 96.62% <98.79%> (?)
Py-3.9.21 97.15% <99.09%> (?)
Py-pypy7.3.16 87.77% <93.95%> (?)
VM-macos 96.83% <98.48%> (?)
VM-ubuntu 97.70% <99.39%> (?)
VM-windows 94.80% <99.09%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TimMenninger TimMenninger marked this pull request as ready for review April 14, 2025 15:19
@TimMenninger
Copy link
Copy Markdown
Contributor Author

I separated out the conflict resolutions for the sake of review. I like leaving it like that but will leave it up to maintainers if I should squash the commits.

@bdraco bdraco changed the title Switch zlib backend 3.12 [PR #10700/ceeca6a backport][3.12] Add support for switching the zlib implementation Apr 14, 2025
Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TimMenninger

@bdraco bdraco merged commit 5268479 into aio-libs:3.12 Apr 14, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants