From 0303e210591af35e33071d2e5bffb37b4c982291 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 11 Oct 2022 23:01:24 +0800 Subject: [PATCH 1/5] Update requirements.txt --- requirements.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 33e1aaa7..798ba5ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,14 @@ jsonschema==3.2.0 aiohttp==3.8.1 aiohttp-cors==0.7.0 -aiofiles==0.8.0 -Jinja2==3.0.3 -sentry-sdk==1.9.10 -psutil==5.9.2 +aiofiles==22.1.0; python_version >= '3.7' +aiofiles==0.8.0; python_version < '3.7' # v0.8.0 is the last version to support Python 3.6 +Jinja2==3.1.2; python_version >= '3.7' +Jinja2==3.0.3; python_version < '3.7' # v3.0.3 is the last version to support Python 3.6 +sentry-sdk==1.9.10,<1.10 +psutil>=5.9.2,<5.10 async-timeout==4.0.2 -distro==1.7.0 +distro==1.8.0 py-cpuinfo==8.0.0 setuptools==60.6.0; python_version >= '3.7' # don't upgrade because of https://github.com/pypa/setuptools/issues/3084 -setuptools==59.6.0; python_version < '3.7' # v59.7.0 dropped support for Python 3.6 +setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6 From 78b2b93540ed7e3c6523d929cd0d1c1829fd5961 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 11 Oct 2022 23:23:15 +0800 Subject: [PATCH 2/5] Update dev-requirements.txt --- dev-requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 86cc066f..8355921e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,8 +1,8 @@ -rrequirements.txt -pytest==7.0.1; python_version < '3.7' # last version to support Python 3.6 -pytest==7.1.2; python_version >= '3.7' +pytest==7.1.3; python_version >= '3.7' +pytest==7.0.1; python_version < '3.7' # v7.0.1 is the last version to support Python 3.6 flake8==5.0.4 pytest-timeout==2.1.0 -pytest-aiohttp==0.3.0; python_version < '3.7' # last version to support Python 3.6 pytest-aiohttp==1.0.4; python_version >= '3.7' +pytest-aiohttp==0.3.0; python_version < '3.7' # last version to support Python 3.6 From 9ff302592c19c259ac1a6ae3f0e2b14ddf74f822 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 12 Oct 2022 21:40:23 +0800 Subject: [PATCH 3/5] Upgrade to aiohttp 3.8.3 --- requirements.txt | 2 +- tests/handlers/api/compute/test_qemu.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 798ba5ef..d2d2c86f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jsonschema==3.2.0 -aiohttp==3.8.1 +aiohttp==3.8.3 aiohttp-cors==0.7.0 aiofiles==22.1.0; python_version >= '3.7' aiofiles==0.8.0; python_version < '3.7' # v0.8.0 is the last version to support Python 3.6 diff --git a/tests/handlers/api/compute/test_qemu.py b/tests/handlers/api/compute/test_qemu.py index 00245f25..95611f10 100644 --- a/tests/handlers/api/compute/test_qemu.py +++ b/tests/handlers/api/compute/test_qemu.py @@ -185,12 +185,14 @@ async def test_qemu_update(compute_api, vm, free_console_port, fake_qemu_vm): "hdb_disk_image": "linux载.img" } - response = await compute_api.put("/projects/{project_id}/qemu/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) - assert response.status == 200 - assert response.json["name"] == "test" - assert response.json["console"] == free_console_port - assert response.json["hdb_disk_image"] == "linux载.img" - assert response.json["ram"] == 1024 + with patch("gns3server.compute.qemu.qemu_vm.QemuVM.updated") as mock: + response = await compute_api.put("/projects/{project_id}/qemu/nodes/{node_id}".format(project_id=vm["project_id"], node_id=vm["node_id"]), params) + assert response.status == 200 + assert response.json["name"] == "test" + assert response.json["console"] == free_console_port + assert response.json["hdb_disk_image"] == "linux载.img" + assert response.json["ram"] == 1024 + assert mock.called async def test_qemu_nio_create_udp(compute_api, vm): From 77dd772314cf78b630c1a7af8779730577ecf9be Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 12 Oct 2022 22:07:37 +0800 Subject: [PATCH 4/5] Allow for more dependency versions at patch level --- requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index d2d2c86f..b56713a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ -jsonschema==3.2.0 -aiohttp==3.8.3 -aiohttp-cors==0.7.0 -aiofiles==22.1.0; python_version >= '3.7' +jsonschema>=4.16.0,<4.17 +aiohttp>=3.8.3,<3.9 +aiohttp-cors>=0.7.0,<0.8 +aiofiles>=22.1.0,<22.2; python_version >= '3.7' aiofiles==0.8.0; python_version < '3.7' # v0.8.0 is the last version to support Python 3.6 -Jinja2==3.1.2; python_version >= '3.7' +Jinja2>=3.1.2,<3.2; python_version >= '3.7' Jinja2==3.0.3; python_version < '3.7' # v3.0.3 is the last version to support Python 3.6 sentry-sdk==1.9.10,<1.10 psutil>=5.9.2,<5.10 -async-timeout==4.0.2 -distro==1.8.0 -py-cpuinfo==8.0.0 -setuptools==60.6.0; python_version >= '3.7' # don't upgrade because of https://github.com/pypa/setuptools/issues/3084 +async-timeout>=4.0.2,<4.1 +distro>=1.7.0 +py-cpuinfo>=8.0.0,<8.1 +setuptools>=60.8.1; python_version >= '3.7' setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6 From 8cfedce468634bd0def7b34611c2b4e43f01de71 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 12 Oct 2022 22:13:34 +0800 Subject: [PATCH 5/5] Use jsonschema v3.2.0 for Python 3.6 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b56713a4..735c4eac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -jsonschema>=4.16.0,<4.17 +jsonschema>=4.16.0,<4.17; python_version >= '3.7' +jsonschema==3.2.0; python_version < '3.7' # v3.2.0 is the last version to support Python 3.6 aiohttp>=3.8.3,<3.9 aiohttp-cors>=0.7.0,<0.8 aiofiles>=22.1.0,<22.2; python_version >= '3.7'