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

[PR #5278/0f0c3759 backport][3.10] Drop Python 3.6 support #8512

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jul 17, 2024

(cherry picked from commit 0f0c375)

@bdraco bdraco force-pushed the patchback/backports/3.10/0f0c3759616e5369403cd711d8ff898c28f38548/pr-5278 branch 2 times, most recently from 76c0843 to c989e29 Compare July 17, 2024 15:08
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jul 17, 2024
@bdraco bdraco changed the title Drop Python 3.6 support (#5278) [PR #5278/0f0c3759 backport][3.10] Drop Python 3.6 support Jul 17, 2024
(cherry picked from commit 0f0c375)
@bdraco bdraco force-pushed the patchback/backports/3.10/0f0c3759616e5369403cd711d8ff898c28f38548/pr-5278 branch from c989e29 to e28da47 Compare July 17, 2024 15:12
@bdraco bdraco marked this pull request as ready for review July 17, 2024 15:18
@bdraco bdraco requested a review from asvetlov as a code owner July 17, 2024 15:18
@bdraco
Copy link
Member Author

bdraco commented Jul 17, 2024

This is a missed backport

@bdraco bdraco enabled auto-merge (squash) July 17, 2024 15:18
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.47%. Comparing base (c12a143) to head (e0b3542).
Report is 213 commits behind head on 3.10.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.10    #8512      +/-   ##
==========================================
+ Coverage   97.46%   97.47%   +0.01%     
==========================================
  Files         108      108              
  Lines       33430    33406      -24     
  Branches     4010     4005       -5     
==========================================
- Hits        32583    32563      -20     
+ Misses        619      617       -2     
+ Partials      228      226       -2     
Flag Coverage Δ
CI-GHA 97.38% <100.00%> (+0.01%) ⬆️
OS-Linux 97.06% <100.00%> (+<0.01%) ⬆️
OS-Windows 94.70% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.73% <100.00%> (+0.01%) ⬆️
Py-3.10.11 96.83% <100.00%> (+<0.01%) ⬆️
Py-3.10.14 96.79% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 97.02% <100.00%> (+0.08%) ⬆️
Py-3.12.4 97.14% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 94.44% <100.00%> (+0.01%) ⬆️
Py-3.8.18 96.69% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 96.83% <100.00%> (+<0.01%) ⬆️
Py-3.9.19 96.80% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 96.36% <100.00%> (+0.01%) ⬆️
VM-macos 96.73% <100.00%> (+0.01%) ⬆️
VM-ubuntu 97.06% <100.00%> (+<0.01%) ⬆️
VM-windows 94.70% <100.00%> (+<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.

@bdraco bdraco disabled auto-merge July 17, 2024 15:34
@bdraco bdraco added bot:chronographer:skip This PR does not need to include a change note and removed bot:chronographer:provided There is a change note present in this PR labels Jul 17, 2024
@bdraco bdraco enabled auto-merge (squash) July 17, 2024 15:35
@bdraco bdraco merged commit 266559c into 3.10 Jul 17, 2024
31 of 32 checks passed
@bdraco bdraco deleted the patchback/backports/3.10/0f0c3759616e5369403cd711d8ff898c28f38548/pr-5278 branch July 17, 2024 15:47
dcermak added a commit to dcermak/py-obs that referenced this pull request Aug 2, 2024
Previously we were storing a ClientSession as a class attribute of Osc. However
as of aio-libs/aiohttp#8512 that breaks, as
aiohttp.ClientSessions require a running asyncio event loop, which is not
guaranteed to exist. Instead we recreate a session inside a api_request which is
an async function and is guaranteed to have a running event loop.
dcermak added a commit to dcermak/py-obs that referenced this pull request Aug 2, 2024
Previously we were storing a `ClientSession` as a class attribute of
`Osc`. However as of aio-libs/aiohttp#8512 that breaks,
as `aiohttp.ClientSession` requires a running asyncio event loop, which is not
guaranteed to exist. Instead we recreate a session inside `api_request` which is
an async function and is guaranteed to have a running event loop.
dcermak added a commit to dcermak/py-obs that referenced this pull request Aug 2, 2024
Previously we were storing a `ClientSession` as a class attribute of
`Osc`. However as of aio-libs/aiohttp#8512 that breaks,
as `aiohttp.ClientSession` requires a running asyncio event loop, which is not
guaranteed to exist. Instead we recreate a session inside `api_request` which is
an async function and is guaranteed to have a running event loop.
dcermak added a commit to dcermak/py-obs that referenced this pull request Aug 2, 2024
Previously we were storing a `ClientSession` as a class attribute of
`Osc`. However as of aio-libs/aiohttp#8512 that breaks,
as `aiohttp.ClientSession` requires a running asyncio event loop, which is not
guaranteed to exist. Instead we recreate a session inside `api_request` which is
an async function and is guaranteed to have a running event loop.
cthulhustig added a commit to cthulhustig/autojimmy that referenced this pull request Aug 7, 2024
Proxy was failing to start with the error below when using aiohttp 3.10.

```
Traceback (most recent call last):
  File "E:\Projects\autojimmy\proxy\mapproxy.py", line 325, in _serviceCallback
    requestHandler = proxy.RequestHandler(
                     ^^^^^^^^^^^^^^^^^^^^^
  File "E:\Projects\autojimmy\proxy\requesthandler.py", line 102, in __init__
    self._connector = aiohttp.TCPConnector(
                      ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\GrooveStar\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 784, in __init__
    super().__init__(
  File "C:\Users\GrooveStar\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\connector.py", line 234, in __init__
    loop = loop or asyncio.get_running_loop()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
An exception occurred while starting the proxy
  File "E:\Projects\autojimmy\jobs\startupjobs.py", line 33, in run
    self.executeJob()
    proxy.MapProxy.instance().start(
  File "E:\Projects\autojimmy\proxy\mapproxy.py", line 161, in start
    raise RuntimeError(f'Map proxy failed to start ({message[1]})')
RuntimeError: Map proxy failed to start (no running event loop)
```

The issue was triggered by [this aiohttp
PR](aio-libs/aiohttp#8512) which changed
behaviour so that some classes must now be explicitly passed a loop at
construction if there isn't one currently running.
dcermak added a commit to dcermak/openapi-generator that referenced this pull request Dec 11, 2024
…nit__

aiohttp's `ClientSession` & `TCPConnector` used to obtain an event loop in
__init__ (via `asyncio.get_event_loop`). However, as of aio-libs/aiohttp#8512 both
classes now obtain the running event loop and won't potentially create one. This
makes it impossible to create `ClientSession` and `TCPConnector` objects outside
of coroutines, as `get_running_loop` must be called from a coroutine.

Thus we defer the creation of a `ClientSession` into the actual request and
cache it for later usage. Thereby we pay only a very small price on the first
request, but subsequent requests will not be any more expensive.
dcermak added a commit to dcermak/openapi-generator that referenced this pull request Dec 11, 2024
…nit__

aiohttp's `ClientSession` & `TCPConnector` used to obtain an event loop in
__init__ (via `asyncio.get_event_loop`). However, as of aio-libs/aiohttp#8512 both
classes now obtain the running event loop and won't potentially create one. This
makes it impossible to create `ClientSession` and `TCPConnector` objects outside
of coroutines, as `get_running_loop` must be called from a coroutine.

Thus we defer the creation of a `ClientSession` into the actual request and
cache it for later usage. Thereby we pay only a very small price on the first
request, but subsequent requests will not be any more expensive.
wing328 pushed a commit to OpenAPITools/openapi-generator that referenced this pull request Dec 15, 2024
…nit__ (#20292)

aiohttp's `ClientSession` & `TCPConnector` used to obtain an event loop in
__init__ (via `asyncio.get_event_loop`). However, as of aio-libs/aiohttp#8512 both
classes now obtain the running event loop and won't potentially create one. This
makes it impossible to create `ClientSession` and `TCPConnector` objects outside
of coroutines, as `get_running_loop` must be called from a coroutine.

Thus we defer the creation of a `ClientSession` into the actual request and
cache it for later usage. Thereby we pay only a very small price on the first
request, but subsequent requests will not be any more expensive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants