Skip to content

Only install async-timeout for Python < 3.11#7556

Merged
Dreamsorcerer merged 2 commits intoaio-libs:masterfrom
cdce8p:async-timeout
Aug 26, 2023
Merged

Only install async-timeout for Python < 3.11#7556
Dreamsorcerer merged 2 commits intoaio-libs:masterfrom
cdce8p:async-timeout

Conversation

@cdce8p
Copy link
Copy Markdown
Contributor

@cdce8p cdce8p commented Aug 25, 2023

What do these changes do?

Replace async-timeout with asyncio.timeout for Python 3.11+.

Overall the change isn't as clean as I would have liked it to be. That's mostly a result of the name conflict with timeout. I'm open for suggestions on how to improve it.

Are there changes in behavior for the user?

async-timeout won't be a dependency for Python 3.11+ any longer.

Related issue number

Fixes: #7502

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 25, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 25, 2023

Codecov Report

Merging #7556 (11d6584) into master (cf97e5b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #7556   +/-   ##
=======================================
  Coverage   97.35%   97.35%           
=======================================
  Files         106      106           
  Lines       31481    31501   +20     
  Branches     3575     3583    +8     
=======================================
+ Hits        30648    30668   +20     
  Misses        630      630           
  Partials      203      203           
Flag Coverage Δ
CI-GHA 97.28% <71.42%> (-0.03%) ⬇️
OS-Linux 96.95% <71.42%> (-0.03%) ⬇️
OS-Windows 95.41% <40.00%> (-0.04%) ⬇️
OS-macOS 96.60% <42.85%> (-0.05%) ⬇️
Py-3.10.11 95.33% <40.00%> (-0.04%) ⬇️
Py-3.10.12 96.81% <42.85%> (-0.05%) ⬇️
Py-3.11.4 96.51% <46.42%> (-0.05%) ⬇️
Py-3.8.10 95.30% <40.00%> (-0.04%) ⬇️
Py-3.8.17 96.75% <42.85%> (-0.05%) ⬇️
Py-3.9.13 95.30% <40.00%> (-0.04%) ⬇️
Py-3.9.17 96.77% <42.85%> (-0.05%) ⬇️
Py-pypy7.3.11 96.31% <42.85%> (-0.06%) ⬇️
VM-macos 96.60% <42.85%> (-0.05%) ⬇️
VM-ubuntu 96.95% <71.42%> (-0.03%) ⬇️
VM-windows 95.41% <40.00%> (-0.04%) ⬇️

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

Files Changed Coverage Δ
aiohttp/client_ws.py 92.59% <100.00%> (+0.10%) ⬆️
aiohttp/helpers.py 95.63% <100.00%> (+0.01%) ⬆️
aiohttp/web_ws.py 93.14% <100.00%> (+0.06%) ⬆️
tests/test_client_ws_functional.py 97.60% <100.00%> (+0.01%) ⬆️
tests/test_helpers.py 99.03% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cdce8p
Copy link
Copy Markdown
Contributor Author

cdce8p commented Aug 26, 2023

I think, this could be tagged for a backport to 3.9 as well.

@Dreamsorcerer
Copy link
Copy Markdown
Member

Great, thanks.

@Dreamsorcerer Dreamsorcerer enabled auto-merge (squash) August 26, 2023 13:37
@Dreamsorcerer Dreamsorcerer merged commit db2c274 into aio-libs:master Aug 26, 2023
@patchback
Copy link
Copy Markdown
Contributor

patchback bot commented Aug 26, 2023

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

❌ Failed to cleanly apply db2c274 on top of patchback/backports/3.9/db2c274c91d17eb410225d504c83d4bd6971d0ae/pr-7556

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

@cdce8p cdce8p deleted the async-timeout branch August 26, 2023 14:19
cdce8p added a commit to cdce8p/aiohttp that referenced this pull request Aug 26, 2023
Replace `async-timeout` with `asyncio.timeout` for Python 3.11+.

Overall the change isn't as clean as I would have liked it to be. That's
mostly a result of the name conflict with `timeout`. I'm open for
suggestions on how to improve it.

`async-timeout` won't be a dependency for Python 3.11+ any longer.

Fixes: aio-libs#7502
(cherry picked from commit db2c274)
@cdce8p
Copy link
Copy Markdown
Contributor Author

cdce8p commented Aug 26, 2023

Dreamsorcerer pushed a commit that referenced this pull request Aug 26, 2023
…7558)

Replace `async-timeout` with `asyncio.timeout` for Python 3.11+.

Overall the change isn't as clean as I would have liked it to be. That's
mostly a result of the name conflict with `timeout`. I'm open for
suggestions on how to improve it.

`async-timeout` won't be a dependency for Python 3.11+ any longer.

Fixes: #7502
(cherry picked from commit db2c274)
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.

Switch to asyncio.timeout()

2 participants