Skip to content
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

Use kwargs in aiohttp.client.request #10300

Merged
merged 7 commits into from
Jan 6, 2025

Conversation

Cycloctane
Copy link
Member

@Cycloctane Cycloctane commented Jan 6, 2025

What do these changes do?

Make aiohttp.client.request use kwargs to let it accept parameters defined in _RequestOptions like ssl.

Are there changes in behavior for the user?

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

Related issue number

Fixes #10077

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

@Cycloctane Cycloctane requested a review from asvetlov as a code owner January 6, 2025 12:42
Copy link

codspeed-hq bot commented Jan 6, 2025

CodSpeed Performance Report

Merging #10300 will not alter performance

Comparing Cycloctane:request_kwargs (5fc22cc) with master (8844385)

Summary

✅ 47 untouched benchmarks

@Cycloctane Cycloctane requested a review from webknjaz as a code owner January 6, 2025 12:54
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

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

Project coverage is 98.77%. Comparing base (8844385) to head (5fc22cc).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
aiohttp/client.py 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10300      +/-   ##
==========================================
- Coverage   98.78%   98.77%   -0.01%     
==========================================
  Files         122      122              
  Lines       37029    37038       +9     
  Branches     2041     2041              
==========================================
+ Hits        36579    36585       +6     
- Misses        311      314       +3     
  Partials      139      139              
Flag Coverage Δ
CI-GHA 98.66% <93.75%> (-0.01%) ⬇️
OS-Linux 98.35% <93.75%> (-0.01%) ⬇️
OS-Windows 96.25% <93.75%> (-0.01%) ⬇️
OS-macOS 97.46% <93.75%> (+<0.01%) ⬆️
Py-3.10.11 97.35% <93.75%> (-0.01%) ⬇️
Py-3.10.15 97.92% <93.75%> (+<0.01%) ⬆️
Py-3.11.11 98.01% <93.75%> (-0.01%) ⬇️
Py-3.11.9 97.43% <93.75%> (+<0.01%) ⬆️
Py-3.12.8 98.44% <93.75%> (+<0.01%) ⬆️
Py-3.13.1 98.43% <93.75%> (+<0.01%) ⬆️
Py-3.9.13 97.24% <93.75%> (+<0.01%) ⬆️
Py-3.9.20 97.80% <93.75%> (-0.01%) ⬇️
Py-pypy7.3.16 97.39% <93.75%> (+<0.01%) ⬆️
VM-macos 97.46% <93.75%> (+<0.01%) ⬆️
VM-ubuntu 98.35% <93.75%> (-0.01%) ⬇️
VM-windows 96.25% <93.75%> (-0.01%) ⬇️

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.

@Dreamsorcerer Dreamsorcerer added the backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot label Jan 6, 2025
@Dreamsorcerer
Copy link
Member

That's a bit weird. It's lost coverage of some exception handling in the autobahn test...

@Dreamsorcerer Dreamsorcerer added the backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot label Jan 6, 2025
@Dreamsorcerer Dreamsorcerer merged commit 3d06cc1 into aio-libs:master Jan 6, 2025
40 of 42 checks passed
Copy link
Contributor

patchback bot commented Jan 6, 2025

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

❌ Failed to cleanly apply 3d06cc1 on top of patchback/backports/3.11/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300

Backporting merged PR #10300 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.11/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300 upstream/3.11
  4. Now, cherry-pick PR Use kwargs in aiohttp.client.request #10300 contents into that branch:
    $ git cherry-pick -x 3d06cc14ad82ce4c207449b593955c23bd5e4d88
    If it'll yell at you with something like fatal: Commit 3d06cc14ad82ce4c207449b593955c23bd5e4d88 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3d06cc14ad82ce4c207449b593955c23bd5e4d88
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Use kwargs in aiohttp.client.request #10300 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.11/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300
  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.

Copy link
Contributor

patchback bot commented Jan 6, 2025

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

❌ Failed to cleanly apply 3d06cc1 on top of patchback/backports/3.12/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300

Backporting merged PR #10300 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.12/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300 upstream/3.12
  4. Now, cherry-pick PR Use kwargs in aiohttp.client.request #10300 contents into that branch:
    $ git cherry-pick -x 3d06cc14ad82ce4c207449b593955c23bd5e4d88
    If it'll yell at you with something like fatal: Commit 3d06cc14ad82ce4c207449b593955c23bd5e4d88 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3d06cc14ad82ce4c207449b593955c23bd5e4d88
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Use kwargs in aiohttp.client.request #10300 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.12/3d06cc14ad82ce4c207449b593955c23bd5e4d88/pr-10300
  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.

@Dreamsorcerer
Copy link
Member

Thanks for that, if you could handle the backports as well, that'd be great.

@Dreamsorcerer Dreamsorcerer mentioned this pull request Jan 6, 2025
5 tasks
@Cycloctane Cycloctane mentioned this pull request Jan 6, 2025
5 tasks
@Cycloctane
Copy link
Member Author

I just realized I forgot to push the documentation updates to this pr. 😢 Opened a new pr to compelete the work.

Cycloctane added a commit to Cycloctane/aiohttp that referenced this pull request Jan 6, 2025
Cycloctane added a commit to Cycloctane/aiohttp that referenced this pull request Jan 6, 2025
Dreamsorcerer pushed a commit that referenced this pull request Jan 6, 2025
Cycloctane added a commit to Cycloctane/aiohttp that referenced this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 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.

aiohttp.request() got an unexpected keyword argument 'ssl'
2 participants