Skip to content

Commit

Permalink
[setup.py] Pin external runtime dependencies at known working versions (
Browse files Browse the repository at this point in the history
sonic-net#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.
  • Loading branch information
jleveque authored Oct 9, 2020
1 parent 2e024de commit e1244a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/bgp_commands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/console_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
assert result.exit_code == 0
2 changes: 1 addition & 1 deletion tests/counterpoll_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e1244a5

Please sign in to comment.