Skip to content

Commit bd2552c

Browse files
cognifloydhjacobs
authored andcommitted
Fix aiohttp upgrade (#951)
* Revert "set max aiohttp version to 3.5.1 (until build is fixed) (#844)" This reverts commit b2a4287. * Fix test_run_with_aiohttp_not_installed Somewhere between 3.5.1 and 3.5.2, the aiohttp reimport started succeeding (in connexion.connexion.cli.run()). It's not clear which change caused the issue, but it's probably one of: - aio-libs/aiohttp#3469 (Remove wildcard imports) - aio-libs/aiohttp#3464 (Don't suppress gunicorn cleanup errors) - aio-libs/aiohttp#3471 (Refactor workers) - aio-libs/aiohttp#3500 (Ignore done tasks) In any case, setting sys.modules['aiohttp'] = None should prevent reimporting it. See: https://stackoverflow.com/a/1350574 I successfully tested locally on py37 with aiohttp 3.5.1 and 3.5.2.
1 parent 54e50f2 commit bd2552c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

requirements-aiohttp.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aiohttp>=2.2.5,<3.5.2
1+
aiohttp>=2.2.5
22
aiohttp-swagger>=1.0.5
33
ujson>=1.35
44
aiohttp_jinja2==0.15.0

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def read_version(package):
3535
swagger_ui_require = 'swagger-ui-bundle>=0.0.2'
3636
flask_require = 'flask>=1.0.4'
3737
aiohttp_require = [
38-
'aiohttp>=2.3.10,<3.5.2',
38+
'aiohttp>=2.3.10',
3939
'aiohttp-jinja2>=0.14.0'
4040
]
4141
ujson_require = 'ujson>=1.35'

tests/test_cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def test_run_with_wsgi_containers(mock_app_run, spec_file):
262262
def test_run_with_aiohttp_not_installed(mock_app_run, spec_file):
263263
import sys
264264
aiohttp_bkp = sys.modules.pop('aiohttp', None)
265+
sys.modules['aiohttp'] = None
265266

266267
runner = CliRunner()
267268

0 commit comments

Comments
 (0)