diff --git a/bindep.txt b/bindep.txt index ab7d31b21b..824e432039 100644 --- a/bindep.txt +++ b/bindep.txt @@ -34,3 +34,7 @@ postgresql-client libnss3-dev [platform:dpkg] mozilla-nss-devel [platform:rpm] nss-devel [platform:rpm] +# NOTE(dirk) needed for PyECLib +liberasurecode-dev [platform:dpkg] +liberasurecode-devel [platform:rpm] +dev-libs/liberasurecode [platform:gentoo] diff --git a/openstack_requirements/cmds/check_conflicts.py b/openstack_requirements/cmds/check_conflicts.py index 22ea0c89cc..e5ec58f932 100644 --- a/openstack_requirements/cmds/check_conflicts.py +++ b/openstack_requirements/cmds/check_conflicts.py @@ -14,6 +14,8 @@ """ +from __future__ import print_function + import argparse import sys import traceback @@ -34,7 +36,11 @@ def main(): parser.add_argument( 'upper_constraints', default='upper-constraints.txt', - help='path to the upper-constraints.txt file', + help='path to the upper-constraints.txt file') + parser.add_argument( + 'uc_xfails', + default='upper-constraints-xfails.txt', + help='Path to the upper-constraints-xfails.txt file', ) args = parser.parse_args() @@ -42,16 +48,35 @@ def main(): print('\nChecking %s' % args.upper_constraints) upper_constraints = read_requirements_file(args.upper_constraints) + xfails = read_requirements_file(args.uc_xfails) for name, spec_list in upper_constraints.items(): try: if name: - print('Checking conflicts for %s' % name) pyver = "python_version=='%s.%s'" % (sys.version_info[0], sys.version_info[1]) for req, original_line in spec_list: if req.markers in ["", pyver]: pkg_resources.require(name) - except pkg_resources.ContextualVersionConflict: + except pkg_resources.ContextualVersionConflict as e: + + if e.dist.key in xfails: + xfail_requirement = xfails[e.dist.key][0][0] + xfail_blacklists = set(xfail_requirement.markers.split(',')) + conflict = e.dist.as_requirement() + conflict_specifiers = ''.join(conflict.specs[0]) + + if (e.required_by.issubset(xfail_blacklists) and + xfail_requirement.package == conflict.name and + conflict_specifiers == xfail_requirement.specifiers): + + print ('XFAIL while checking conflicts ' + 'for %s: %s conflicts with %s' % + (name, e.dist, str(e.req))) + continue + + print('Checking conflicts for %s:\n' + 'ContextualVersionConflict: %s' % (name, str(e))) + traceback.print_exc(file=sys.stdout) error_count += 1 diff --git a/tox.ini b/tox.ini index 3d30c36285..73a7fe0e87 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ commands = check-conflicts {toxinidir}/upper-constraints.txt [testenv:py27-check-uc] deps = -r{toxinidir}/upper-constraints.txt -commands = check-conflicts {toxinidir}/upper-constraints.txt +commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt [testenv:venv] commands = {posargs} diff --git a/upper-constraints-xfails.txt b/upper-constraints-xfails.txt new file mode 100644 index 0000000000..a2668ef757 --- /dev/null +++ b/upper-constraints-xfails.txt @@ -0,0 +1,5 @@ +# Format is +# ==; + +pyparsing==2.1.9;pulp +Sphinx==1.3.6;os-api-ref,openstack-doc-tools