Skip to content

Add output_size property#12452

Merged
Dreamsorcerer merged 14 commits into
masterfrom
output-size
May 19, 2026
Merged

Add output_size property#12452
Dreamsorcerer merged 14 commits into
masterfrom
output-size

Conversation

@Dreamsorcerer

@Dreamsorcerer Dreamsorcerer commented May 4, 2026

Copy link
Copy Markdown
Member

Can be used to query upload progress.

@Dreamsorcerer Dreamsorcerer added the backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot label May 4, 2026
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label May 4, 2026
Comment thread tests/test_client_response.py Fixed
@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.95%. Comparing base (247b323) to head (8d2a6ea).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #12452    +/-   ##
========================================
  Coverage   98.94%   98.95%            
========================================
  Files         131      131            
  Lines       46475    46620   +145     
  Branches     2410     2418     +8     
========================================
+ Hits        45987    46132   +145     
  Misses        366      366            
  Partials      122      122            
Flag Coverage Δ
Autobahn 22.40% <14.76%> (-0.03%) ⬇️
CI-GHA 98.92% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.67% <100.00%> (+<0.01%) ⬆️
OS-Windows 97.03% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.93% <100.00%> (+0.01%) ⬆️
Py-3.10 98.15% <100.00%> (?)
Py-3.10.11 ?
Py-3.10.20 ?
Py-3.11 98.41% <100.00%> (?)
Py-3.11.15 ?
Py-3.11.9 ?
Py-3.12 98.49% <100.00%> (?)
Py-3.12.10 ?
Py-3.12.13 ?
Py-3.13 98.47% <100.00%> (?)
Py-3.13.13 ?
Py-3.14 98.49% <100.00%> (?)
Py-3.14.4 ?
Py-3.14.5 ?
Py-3.14.5t ?
Py-3.14t 97.55% <100.00%> (?)
Py-pypy-3.11 97.42% <100.00%> (?)
Py-pypy3.11.15-7.3.22 ?
VM-macos 97.93% <100.00%> (+0.01%) ⬆️
VM-ubuntu 98.67% <100.00%> (+<0.01%) ⬆️
VM-windows 97.03% <100.00%> (+<0.01%) ⬆️
cython-coverage 37.94% <97.31%> (+0.20%) ⬆️

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.

Comment thread aiohttp/client_reqrep.py Outdated
Dreamsorcerer and others added 3 commits May 4, 2026 15:06
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Comment thread tests/test_client_functional.py Outdated
@codspeed-hq

codspeed-hq Bot commented May 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 68 untouched benchmarks
⏩ 72 skipped benchmarks1


Comparing output-size (8d2a6ea) with master (8ea87a1)

Open in CodSpeed

Footnotes

  1. 72 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@bdraco bdraco self-requested a review May 10, 2026 22:47
Comment thread aiohttp/client_reqrep.py Outdated
Comment thread aiohttp/client_reqrep.py Outdated
Comment thread docs/client_reference.rst Outdated
@bdraco

bdraco commented May 18, 2026

Copy link
Copy Markdown
Member

Thanks @Dreamsorcerer

nice addition

Comment thread docs/client_reference.rst
@Dreamsorcerer Dreamsorcerer merged commit 37cd4a8 into master May 19, 2026
49 checks passed
@Dreamsorcerer Dreamsorcerer deleted the output-size branch May 19, 2026 17:36
@patchback

patchback Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Backport to 3.14: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 37cd4a8 on top of patchback/backports/3.14/37cd4a8edcbfe543067a96e36f4da3e9395328a3/pr-12452

Backporting merged PR #12452 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.14/37cd4a8edcbfe543067a96e36f4da3e9395328a3/pr-12452 upstream/3.14
  4. Now, cherry-pick PR Add output_size property #12452 contents into that branch:
    $ git cherry-pick -x 37cd4a8edcbfe543067a96e36f4da3e9395328a3
    If it'll yell at you with something like fatal: Commit 37cd4a8edcbfe543067a96e36f4da3e9395328a3 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 37cd4a8edcbfe543067a96e36f4da3e9395328a3
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Add output_size property #12452 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.14/37cd4a8edcbfe543067a96e36f4da3e9395328a3/pr-12452
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Comment thread CHANGES/12452.feature.rst
@@ -0,0 +1,2 @@
Added :attr:`~aiohttp.ClientResponse.output_size` and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Dreamsorcerer FYI this is rendered as just output_size so maybe for such cases we could either drop that leading ~ or use custom text like ClientResponse.output_size().

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd really like to stop using these directives in the change fragments entirely... In the GH changelog (which is probably more frequently looked at than the Sphinx ones), this just looks incredibly awkward. It also increases the maintenance burden because we keep needing to remove these directives from the changelog when we remove/rename something in a future version.

Comment thread docs/client_reference.rst

Use ``await resp.upload_complete`` to block until the upload finishes, or
``resp.upload_complete.done()`` to poll from a progress-sampling loop
(see :attr:`output_size`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Dreamsorcerer FYI the .. seealso:: directive could be a good fit for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-3.14 Trigger automatic backporting to the 3.14 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.

4 participants