Skip to content

Commit

Permalink
fix 3.6 support and allow keepalive_timeout to be None (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehesiod committed May 6, 2022
1 parent 0c6c571 commit d9e1438
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Test
strategy:
matrix:
pyver: [3.8, 3.9]
pyver: [3.6, 3.8, 3.9]
os: [ubuntu]
fail-fast: true
runs-on: ${{ matrix.os }}-latest
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Changes
-------
2.3.1 (2022-05-06)
^^^^^^^^^^^^^^^^^^
* fix 3.6 support
* AioConfig: allow keepalive_timeout to be None (thanks @dnlserrano #933)

2.3.0 (2022-05-05)
^^^^^^^^^^^^^^^^^^
* fix encoding issue by swapping to AioAWSResponse and AioAWSRequest to behave more
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.0'
__version__ = '2.3.1'
4 changes: 2 additions & 2 deletions aiobotocore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def _validate_connector_args(connector_args):
raise ParamValidationError(
report='{} value must be a boolean'.format(k))
elif k in ['keepalive_timeout']:
if not isinstance(v, (float, int)):
if v is not None and not isinstance(v, (float, int)):
raise ParamValidationError(
report='{} value must be a float/int'.format(k))
report='{} value must be a float/int or None'.format(k))
elif k == 'force_close':
if not isinstance(v, bool):
raise ParamValidationError(
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'aiohttp>=3.3.1',
'wrapt>=1.10.10',
'aioitertools>=0.5.1',
"async_generator ; python_version<'3.7'",
]

extras_require = {
Expand Down
7 changes: 6 additions & 1 deletion tests/botocore/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
import sys
import tempfile
import uuid
from contextlib import asynccontextmanager

try:
from contextlib import asynccontextmanager
except ImportError:
from async_generator import asynccontextmanager

from datetime import datetime, timedelta
import json
import subprocess
Expand Down
8 changes: 7 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def test_connector_args():
connector_args = dict(force_close="1")
AioConfig(connector_args)

with pytest.raises(ParamValidationError):
# wrong type
connector_args = dict(keepalive_timeout="1")
AioConfig(connector_args)

with pytest.raises(ParamValidationError):
# wrong type
connector_args = dict(ssl_context="1")
Expand All @@ -43,10 +48,11 @@ def test_connector_args():
connector_args = dict(foo="1")
AioConfig(connector_args)

# Test valid config:
# Test valid configs:
AioConfig({
"resolver": aiohttp.resolver.DefaultResolver()
})
AioConfig({'keepalive_timeout': None})

# test merge
cfg = Config(read_timeout=75)
Expand Down

0 comments on commit d9e1438

Please sign in to comment.