Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyyaml 3.13 or older (avoid 5.x for now). #3165

Merged
merged 3 commits into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Depends: python3-oslo.config (>= 1:3.9~),
python3-networkx (>= 1.9),
python3-pbr (>= 1.9),
python3-prometheus-client (>= 0.7.1), python3-prometheus-client (<< 0.7.2),
python3-yaml (>= 3.1.1),
python3-yaml (>= 3.1.1), python3-yaml (<= 3.13),
python3-eventlet (>= 0.24.1), python3-eventlet (<< 0.24.2),
python3-ryu (>= 4.32), python3-ryu (<< 4.33),
python3-beka (>= 0.3.3), python3-beka (<< 0.3.4),
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgpack-python
networkx
pbr>=1.9
prometheus_client==0.7.1
pyyaml
pyyaml>=3.1.1,<=3.13
ryu==4.32
beka==0.3.3
pytricia
31 changes: 16 additions & 15 deletions tests/unit/packaging/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUp(self):
'pyyaml': 'python3-yaml'
}

with open(self.control_file) as handle:
with open(self.control_file, 'r', encoding='utf-8') as handle:
control = handle.read()

faucet_dpkg = str()
Expand Down Expand Up @@ -88,23 +88,24 @@ def test_every_pip_requirement_has_matching_version_in_debian_package(self):
dpkg_name = "python3-{}".format(pip_req.name)

if pip_req.req.specifier:
pip_req_version = str(pip_req.req.specifier)
pip_req_versions = str(pip_req.req.specifier)
debian_package_dependencies = [
pip_req.name+x for x in self.faucet_dpkg_deps[dpkg_name]
]
if str(pip_req_version).startswith('=='):
# debian/control is annoying about how it handles exact
# versions, calculate the debian equivalent of the
# pip requirements match and compare that
lower_match = pip_req_version.replace('==', '>=')
upper_match = pip_req_version.replace('==', '<<').split('.')
upper_match[-1] = str(int(upper_match[-1]) + 1)
upper_match = '.'.join(upper_match)

self.assertIn(pip_req.name+lower_match, debian_package_dependencies)
self.assertIn(pip_req.name+upper_match, debian_package_dependencies)
else:
self.assertIn(pip_req.name+pip_req_version, debian_package_dependencies)
for pip_req_version in pip_req_versions.split(','):
if str(pip_req_version).startswith('=='):
# debian/control is annoying about how it handles exact
# versions, calculate the debian equivalent of the
# pip requirements match and compare that
lower_match = pip_req_version.replace('==', '>=')
upper_match = pip_req_version.replace('==', '<<').split('.')
upper_match[-1] = str(int(upper_match[-1]) + 1)
upper_match = '.'.join(upper_match)

self.assertIn(pip_req.name+lower_match, debian_package_dependencies)
self.assertIn(pip_req.name+upper_match, debian_package_dependencies)
else:
self.assertIn(pip_req.name+pip_req_version, debian_package_dependencies)


if __name__ == "__main__":
Expand Down