Skip to content

Add support for ZSTD compression #11161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

KGuillaume-chaps
Copy link

@KGuillaume-chaps KGuillaume-chaps commented Jun 9, 2025

What do these changes do?

This patch adds support for ZSTD compression, as supported by the Firefox browser and the Caddy web server

Are there changes in behavior for the user?

If the user doesn't install the zstandard library, nothing will change.

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

The impact on existing code is low to none, and there are unit tests to ensure nothing breaks.

Related issue number

No related issue

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.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 9, 2025
Copy link

codspeed-hq bot commented Jun 9, 2025

CodSpeed Performance Report

Merging #11161 will not alter performance

Comparing KGuillaume-chaps:zstd (0c85e3e) with master (4a993e6)

Summary

✅ 59 untouched benchmarks

Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 80.30303% with 13 lines in your changes missing coverage. Please review.

Project coverage is 98.80%. Comparing base (8795da3) to head (0c30ac7).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
aiohttp/compression_utils.py 52.63% 6 Missing and 3 partials ⚠️
aiohttp/http_parser.py 71.42% 1 Missing and 1 partial ⚠️
tests/test_http_parser.py 93.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11161      +/-   ##
==========================================
- Coverage   98.85%   98.80%   -0.05%     
==========================================
  Files         131      131              
  Lines       42966    43024      +58     
  Branches     2314     2321       +7     
==========================================
+ Hits        42476    42512      +36     
- Misses        340      355      +15     
- Partials      150      157       +7     
Flag Coverage Δ
CI-GHA 98.70% <80.30%> (-0.05%) ⬇️
OS-Linux 98.43% <80.30%> (-0.05%) ⬇️
OS-Windows 96.77% <80.30%> (-0.04%) ⬇️
OS-macOS 97.67% <80.30%> (-0.04%) ⬇️
Py-3.10.11 97.32% <80.30%> (-0.04%) ⬇️
Py-3.10.17 97.81% <80.30%> (-0.03%) ⬇️
Py-3.11.12 97.99% <80.30%> (-0.03%) ⬇️
Py-3.11.9 97.51% <80.30%> (-0.04%) ⬇️
Py-3.12.10 98.37% <80.30%> (-0.03%) ⬇️
Py-3.13.3 98.35% <80.30%> (-0.03%) ⬇️
Py-3.9.13 97.20% <80.30%> (-0.04%) ⬇️
Py-3.9.22 97.68% <80.30%> (-0.04%) ⬇️
Py-pypy7.3.16 ?
VM-macos 97.67% <80.30%> (-0.04%) ⬇️
VM-ubuntu 98.43% <80.30%> (-0.05%) ⬇️
VM-windows 96.77% <80.30%> (-0.04%) ⬇️

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.

Copy link
Member

@Dreamsorcerer Dreamsorcerer left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

We should really look at a more general way to support arbitrary compression methods in future though..

@Dreamsorcerer Dreamsorcerer added the backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot 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