From e1244a55d8706507df8f98eacb19c37e793e482a Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 9 Oct 2020 15:47:57 -0700 Subject: [PATCH] [setup.py] Pin external runtime dependencies at known working versions (#1151) To ensure a smooth transition once we stop installing the dependencies explicitly in the SONiC image. We can upgrade dependencies selectively in the future. Also had to replace single-quotes with double-quotes in expected Click error messages, as it seems the Click package installed via pip uses double quotes, whereas the package installed via Debian used single-quotes. --- setup.py | 17 +++++++++-------- tests/bgp_commands_test.py | 2 +- tests/console_test.py | 4 ++-- tests/counterpoll_test.py | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 214d503c0e..a84d033e27 100644 --- a/setup.py +++ b/setup.py @@ -140,19 +140,20 @@ ] }, install_requires=[ - 'click', - 'ipaddress', + 'click==7.0', + 'ipaddress==1.0.23', 'jsondiff==1.2.0', - 'm2crypto', - 'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2 - 'netaddr', - 'netifaces', - 'pexpect', + 'm2crypto==0.31.0', + 'natsort==6.2.1', # 6.2.1 is the last version which supports Python 2 + 'netaddr==0.8.0', + 'netifaces==0.10.7', + 'pexpect==4.8.0', 'sonic-py-common', 'sonic-yang-mgmt', 'swsssdk>=2.0.1', 'tabulate==0.8.2', - 'xmltodict==0.12.0' + 'xmltodict==0.12.0', + 'zipp==1.2.0' # Need to pin this down for Python 2, for Python 3 we should be able to remove altogether ], setup_requires= [ 'pytest-runner', diff --git a/tests/bgp_commands_test.py b/tests/bgp_commands_test.py index 49c6ddb404..2b9f461004 100644 --- a/tests/bgp_commands_test.py +++ b/tests/bgp_commands_test.py @@ -86,7 +86,7 @@ show_error_invalid_json = """\ Usage: summary [OPTIONS] -Try 'summary --help' for help. +Try "summary --help" for help. Error: bgp summary from bgp container not in json format """ diff --git a/tests/console_test.py b/tests/console_test.py index 98a10c043e..1e2afe7afd 100644 --- a/tests/console_test.py +++ b/tests/console_test.py @@ -34,7 +34,7 @@ def test_console_add_no_baud(self): print(result.exit_code) print(sys.stderr, result.output) assert result.exit_code != 0 - assert "Missing option '--baud'" in result.output + assert "Missing option \"--baud\"" in result.output def test_console_add_name_conflict(self): runner = CliRunner() @@ -84,4 +84,4 @@ def test_console_del_success(self): result = runner.invoke(config.config.commands["console"].commands["del"], ["1"], obj=db) print(result.exit_code) print(sys.stderr, result.output) - assert result.exit_code == 0 \ No newline at end of file + assert result.exit_code == 0 diff --git a/tests/counterpoll_test.py b/tests/counterpoll_test.py index b2c806b95c..f934a94739 100644 --- a/tests/counterpoll_test.py +++ b/tests/counterpoll_test.py @@ -47,7 +47,7 @@ def test_port_buffer_drop_interval_too_short(self): runner = CliRunner() result = runner.invoke(counterpoll.cli.commands["port-buffer-drop"].commands["interval"], ["1000"]) print(result.output) - expected = "Invalid value for 'POLL_INTERVAL': 1000 is not in the valid range of 30000 to 300000." + expected = "Invalid value for \"POLL_INTERVAL\": 1000 is not in the valid range of 30000 to 300000." assert result.exit_code == 2 assert expected in result.output