Skip to content

Commit 96f9645

Browse files
authored
Fix endpoint circular import issue (#1395)
1 parent d3c9644 commit 96f9645

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

.github/workflows/ci-cd.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ jobs:
5050
os: ubuntu-24.04
5151
no-httpx: true
5252
experimental: false
53-
# add experimental 3.14 runs. Move this to being a 3.14 python-version
54-
# entry when stable.
55-
- python-version: 3.14
56-
os: ubuntu-24.04
57-
no-httpx: false
58-
experimental: true
59-
- python-version: 3.14
60-
os: ubuntu-24.04-arm
61-
no-httpx: false
62-
experimental: true
53+
54+
# add experimental 3.14 runs. Move this to being a 3.14 python-version
55+
# entry when stable.
56+
# - python-version: 3.14
57+
# os: ubuntu-24.04
58+
# no-httpx: false
59+
# experimental: true
60+
# - python-version: 3.14
61+
# os: ubuntu-24.04-arm
62+
# no-httpx: false
63+
# experimental: true
6364
fail-fast: false
6465
uses: ./.github/workflows/reusable-test.yml
6566
with:

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Changes
22
-------
3+
2.24.1 (2025-08-15)
4+
^^^^^^^^^^^^^^^^^^^
5+
* fix endpoint circular import error
36

47
2.24.0 (2025-07-31)
58
^^^^^^^^^^^^^^^^^^^

aiobotocore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.24.0'
1+
__version__ = '2.24.1'

aiobotocore/_constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# AWS has a 20 second idle timeout:
2+
# https://web.archive.org/web/20150926192339/https://forums.aws.amazon.com/message.jspa?messageID=215367
3+
# and aiohttp default timeout is 30s so we set it to something
4+
# reasonable here
5+
DEFAULT_KEEPALIVE_TIMEOUT = 12

aiobotocore/config.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
import botocore.client
44
from botocore.exceptions import ParamValidationError
55

6-
from aiobotocore.endpoint import DEFAULT_HTTP_SESSION_CLS
7-
from aiobotocore.httpxsession import HttpxSession
8-
9-
# AWS has a 20 second idle timeout:
10-
# https://web.archive.org/web/20150926192339/https://forums.aws.amazon.com/message.jspa?messageID=215367
11-
# and aiohttp default timeout is 30s so we set it to something
12-
# reasonable here
13-
DEFAULT_KEEPALIVE_TIMEOUT = 12
6+
from ._constants import DEFAULT_KEEPALIVE_TIMEOUT
7+
from .endpoint import DEFAULT_HTTP_SESSION_CLS
8+
from .httpxsession import HttpxSession
149

1510
TIMEOUT_ARGS = frozenset(
1611
('keepalive_timeout', 'write_timeout', 'pool_timeout')

aiobotocore/httpsession.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
from multidict import CIMultiDict
4141

4242
import aiobotocore.awsrequest
43-
import aiobotocore.config
44-
from aiobotocore._endpoint_helpers import _IOBaseWrapper, _text
43+
44+
from ._constants import DEFAULT_KEEPALIVE_TIMEOUT
45+
from ._endpoint_helpers import _IOBaseWrapper, _text
4546

4647

4748
class AIOHTTPSession:
@@ -85,7 +86,7 @@ def __init__(
8586
self._connector_args = connector_args
8687
if self._connector_args is None:
8788
self._connector_args = dict(
88-
keepalive_timeout=aiobotocore.config.DEFAULT_KEEPALIVE_TIMEOUT
89+
keepalive_timeout=DEFAULT_KEEPALIVE_TIMEOUT
8990
)
9091

9192
self._max_pool_connections = max_pool_connections

aiobotocore/httpxsession.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
from multidict import CIMultiDict
2727

2828
import aiobotocore.awsrequest
29-
import aiobotocore.config # avoid circular import
3029
from aiobotocore._endpoint_helpers import _text
3130

31+
from ._constants import DEFAULT_KEEPALIVE_TIMEOUT
32+
3233
try:
3334
import httpx
3435
except ImportError:
@@ -61,7 +62,7 @@ def __init__(
6162

6263
if connector_args is None:
6364
self._connector_args: dict[str, Any] = {
64-
'keepalive_timeout': aiobotocore.config.DEFAULT_KEEPALIVE_TIMEOUT
65+
'keepalive_timeout': DEFAULT_KEEPALIVE_TIMEOUT
6566
}
6667
else:
6768
self._connector_args = connector_args

0 commit comments

Comments
 (0)