diff --git a/CHANGES.txt b/CHANGES.txt index eb39ca55..1b9822d0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,7 @@ Changes ^^^^^^^^^^^^^^^^^^ * Added enforcement of plain response #57 (thanks @rymir) +* botocore updated to version 1.4.73 #74 (thanks @vas3k) 0.0.5 (2016-06-01) diff --git a/aiobotocore/__init__.py b/aiobotocore/__init__.py index 0f7897fe..ae082d84 100644 --- a/aiobotocore/__init__.py +++ b/aiobotocore/__init__.py @@ -1,4 +1,4 @@ from .session import get_session, AioSession -__version__ = '0.0.5' +__version__ = '0.0.6' (get_session, AioSession) # make pyflakes happy diff --git a/aiobotocore/client.py b/aiobotocore/client.py index ff26eeed..2817c85b 100644 --- a/aiobotocore/client.py +++ b/aiobotocore/client.py @@ -133,9 +133,10 @@ def __aexit__(self, exc_type, exc_val, exc_tb): exc_val, exc_tb) def close(self): - """Close all http connections""" - # ClientSession.close() from aiohttp returns asyncio.Future here so - # this method could be used with yield from/await + """Close all http connections. This is coroutine, and should be + awaited. Method will be coroutine (instead returning Future) once + aiohttp does that. + """ return self._endpoint._aio_session.close() diff --git a/examples/simple.py b/examples/simple.py index a114a1d2..875948f4 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -32,5 +32,6 @@ def go(loop): resp = yield from client.delete_object(Bucket=bucket, Key=key) print(resp) + loop = asyncio.get_event_loop() loop.run_until_complete(go(loop)) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3bf4ebc1..fbf967a6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -flake8==3.0.4 +flake8==3.2.0 pytest==3.0.4 pytest-cov==2.4.0 coverage==4.2 diff --git a/setup.py b/setup.py index 999d5b6f..c2afafc3 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages -install_requires = ['botocore>=1.4.0, <=1.4.73', 'aiohttp>=0.21.2'] +install_requires = ['botocore>=1.4.29, <=1.4.73', 'aiohttp>=0.22.5'] PY_VER = sys.version_info diff --git a/tests/test_basic_s3.py b/tests/test_basic_s3.py index 9e68a623..9c5d6ec0 100644 --- a/tests/test_basic_s3.py +++ b/tests/test_basic_s3.py @@ -124,6 +124,7 @@ def test_get_object_stream_wrapper(s3_client, create_object, bucket_name): chunk2 = yield from body.read() assert chunk1 == b'b' assert chunk2 == b'ody contents' + response['Body'].close() @pytest.mark.run_loop @@ -204,6 +205,7 @@ def test_unicode_key_put_list(s3_client, bucket_name, create_object): assert parsed['Contents'][0]['Key'] == key_name parsed = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name) data = yield from parsed['Body'].read() + parsed['Body'].close() assert data == b'foo' @@ -255,6 +257,7 @@ def test_copy_with_quoted_char(s3_client, create_object, bucket_name): # Now verify we can retrieve the copied object. resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2) data = yield from resp['Body'].read() + resp['Body'].close() assert data == b'foo' @@ -271,6 +274,7 @@ def test_copy_with_query_string(s3_client, create_object, bucket_name): # Now verify we can retrieve the copied object. resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2) data = yield from resp['Body'].read() + resp['Body'].close() assert data == b'foo' @@ -287,6 +291,7 @@ def test_can_copy_with_dict_form(s3_client, create_object, bucket_name): # Now verify we can retrieve the copied object. resp = yield from s3_client.get_object(Bucket=bucket_name, Key=key_name2) data = yield from resp['Body'].read() + resp['Body'].close() assert data == b'foo'