diff --git a/.gitignore b/.gitignore index 2a04ce9a56..251d3c08a5 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,4 @@ Makefile.in.in /tests/rpmtests.dir /tests/rpmtests.log /tests/testing/ +/tests/data/scripts_pythondistdeps/usr/ diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py index 4032857021..102fcb0e80 100755 --- a/scripts/pythondistdeps.py +++ b/scripts/pythondistdeps.py @@ -11,6 +11,10 @@ # RPM python dependency generator, using .egg-info/.egg-link/.dist-info data # +# Please know: +# - Notes from an attempted rewrite from pkg_resources to importlib.metadata in +# 2020 can be found in the message of the commit that added this line. + from __future__ import print_function import argparse from os.path import basename, dirname, isdir, sep @@ -51,7 +55,7 @@ def __str__(self): if self.pre: rpm_suffix = '~{}'.format(''.join(str(x) for x in self.pre)) elif self.dev: - rpm_suffix = '~{}'.format(''.join(str(x) for x in self.dev)) + rpm_suffix = '~~{}'.format(''.join(str(x) for x in self.dev)) elif self.post: rpm_suffix = '^post{}'.format(self.post[1]) else: @@ -130,200 +134,292 @@ def convert_ordered(name, operator, version_id): def convert(name, operator, version_id): - return OPERATORS[operator](name, operator, version_id) - - -parser = argparse.ArgumentParser(prog=argv[0]) -group = parser.add_mutually_exclusive_group(required=True) -group.add_argument('-P', '--provides', action='store_true', help='Print Provides') -group.add_argument('-R', '--requires', action='store_true', help='Print Requires') -group.add_argument('-r', '--recommends', action='store_true', help='Print Recommends') -group.add_argument('-C', '--conflicts', action='store_true', help='Print Conflicts') -group.add_argument('-E', '--extras', action='store_true', help='Print Extras') -parser.add_argument('-M', '--majorver-provides', action='store_true', help='Print extra Provides with Python major version only') -parser.add_argument('-m', '--majorver-only', action='store_true', help='Print Provides/Requires with Python major version only') -parser.add_argument('-L', '--legacy-provides', action='store_true', help='Print extra legacy pythonegg Provides') -parser.add_argument('-l', '--legacy', action='store_true', help='Print legacy pythonegg Provides/Requires instead') -parser.add_argument('files', nargs=argparse.REMAINDER) -args = parser.parse_args() - -py_abi = args.requires -py_deps = {} - - -for f in (args.files or stdin.readlines()): - f = f.strip() - lower = f.lower() - name = 'python(abi)' - # add dependency based on path, versioned if within versioned python directory - if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')): - if name not in py_deps: - py_deps[name] = [] - purelib = get_python_lib(standard_lib=0, plat_specific=0).split(version[:3])[0] - platlib = get_python_lib(standard_lib=0, plat_specific=1).split(version[:3])[0] - for lib in (purelib, platlib): - if lib in f: - spec = ('==', f.split(lib)[1].split(sep)[0]) - if spec not in py_deps[name]: - py_deps[name].append(spec) - - # XXX: hack to workaround RPM internal dependency generator not passing directories - lower_dir = dirname(lower) - if lower_dir.endswith('.egg') or \ - lower_dir.endswith('.egg-info') or \ - lower_dir.endswith('.dist-info'): - lower = lower_dir - f = dirname(f) - # Determine provide, requires, conflicts & recommends based on egg/dist metadata - if lower.endswith('.egg') or \ - lower.endswith('.egg-info') or \ - lower.endswith('.dist-info'): - # This import is very slow, so only do it if needed - from pkg_resources import Distribution, FileMetadata, PathMetadata, Requirement, parse_version - dist_name = basename(f) - if isdir(f): - path_item = dirname(f) - metadata = PathMetadata(path_item, f) - else: - path_item = f - metadata = FileMetadata(f) - dist = Distribution.from_location(path_item, dist_name, metadata) - # Check if py_version is defined in the metadata file/directory name - if not dist.py_version: - # Try to parse the Python version from the path the metadata - # resides at (e.g. /usr/lib/pythonX.Y/site-packages/...) - import re - res = re.search(r"/python(?P\d+\.\d+)/", path_item) - if res: - dist.py_version = res.group('pyver') - else: - warn("Version for {!r} has not been found".format(dist), RuntimeWarning) - continue - if args.majorver_provides or args.majorver_only or args.legacy_provides or args.legacy: - # Get the Python major version - pyver_major = dist.py_version.split('.')[0] - if args.provides: - # If egg/dist metadata says package name is python, we provide python(abi) - if dist.key == 'python': - name = 'python(abi)' - if name not in py_deps: - py_deps[name] = [] - py_deps[name].append(('==', dist.py_version)) - if not args.legacy or not args.majorver_only: - name = 'python{}dist({})'.format(dist.py_version, dist.key) - if name not in py_deps: - py_deps[name] = [] - if args.majorver_provides or args.majorver_only: - pymajor_name = 'python{}dist({})'.format(pyver_major, dist.key) - if pymajor_name not in py_deps: - py_deps[pymajor_name] = [] - if args.legacy or args.legacy_provides: - legacy_name = 'pythonegg({})({})'.format(pyver_major, dist.key) - if legacy_name not in py_deps: - py_deps[legacy_name] = [] - if dist.version: - version = dist.version - spec = ('==', version) - if spec not in py_deps[name]: - if not args.legacy: + try: + return OPERATORS[operator](name, operator, version_id) + except Exception as exc: + raise RuntimeError("Cannot process Python package version `{}` for name `{}`". + format(version_id, name)) from exc + + +def normalize_name(name): + """https://www.python.org/dev/peps/pep-0503/#normalized-names""" + import re + return re.sub(r'[-_.]+', '-', name).lower() + + +if __name__ == "__main__": + """To allow this script to be importable (and its classes/functions + reused), actions are performed only when run as a main script.""" + + parser = argparse.ArgumentParser(prog=argv[0]) + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-P', '--provides', action='store_true', help='Print Provides') + group.add_argument('-R', '--requires', action='store_true', help='Print Requires') + group.add_argument('-r', '--recommends', action='store_true', help='Print Recommends') + group.add_argument('-C', '--conflicts', action='store_true', help='Print Conflicts') + group.add_argument('-E', '--extras', action='store_true', help='Print Extras') + group_majorver = parser.add_mutually_exclusive_group() + group_majorver.add_argument('-M', '--majorver-provides', action='store_true', help='Print extra Provides with Python major version only') + group_majorver.add_argument('--majorver-provides-versions', action='append', + help='Print extra Provides with Python major version only for listed ' + 'Python VERSIONS (appended or comma separated without spaces, e.g. 2.7,3.9)') + parser.add_argument('-m', '--majorver-only', action='store_true', help='Print Provides/Requires with Python major version only') + parser.add_argument('-n', '--normalized-names-format', action='store', + default="legacy-dots", choices=["pep503", "legacy-dots"], + help='Format of normalized names according to pep503 or legacy format that allows dots [default]') + parser.add_argument('--normalized-names-provide-both', action='store_true', + help='Provide both `pep503` and `legacy-dots` format of normalized names (useful for a transition period)') + parser.add_argument('-L', '--legacy-provides', action='store_true', help='Print extra legacy pythonegg Provides') + parser.add_argument('-l', '--legacy', action='store_true', help='Print legacy pythonegg Provides/Requires instead') + parser.add_argument('files', nargs=argparse.REMAINDER) + args = parser.parse_args() + + py_abi = args.requires + py_deps = {} + + if args.majorver_provides_versions: + # Go through the arguments (can be specified multiple times), + # and parse individual versions (can be comma-separated) + args.majorver_provides_versions = [v for vstring in args.majorver_provides_versions + for v in vstring.split(",")] + + # If normalized_names_require_pep503 is True we require the pep503 + # normalized name, if it is False we provide the legacy normalized name + normalized_names_require_pep503 = args.normalized_names_format == "pep503" + + # If normalized_names_provide_pep503/legacy is True we provide the + # pep503/legacy normalized name, if it is False we don't + normalized_names_provide_pep503 = \ + args.normalized_names_format == "pep503" or args.normalized_names_provide_both + normalized_names_provide_legacy = \ + args.normalized_names_format == "legacy-dots" or args.normalized_names_provide_both + + # At least one type of normalization must be provided + assert normalized_names_provide_pep503 or normalized_names_provide_legacy + + for f in (args.files or stdin.readlines()): + f = f.strip() + lower = f.lower() + name = 'python(abi)' + # add dependency based on path, versioned if within versioned python directory + if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')): + if name not in py_deps: + py_deps[name] = [] + purelib = get_python_lib(standard_lib=0, plat_specific=0).split(version[:3])[0] + platlib = get_python_lib(standard_lib=0, plat_specific=1).split(version[:3])[0] + for lib in (purelib, platlib): + if lib in f: + spec = ('==', f.split(lib)[1].split(sep)[0]) + if spec not in py_deps[name]: py_deps[name].append(spec) - if args.majorver_provides: - py_deps[pymajor_name].append(spec) - if args.legacy or args.legacy_provides: - py_deps[legacy_name].append(spec) - if args.requires or (args.recommends and dist.extras): - name = 'python(abi)' - # If egg/dist metadata says package name is python, we don't add dependency on python(abi) - if dist.key == 'python': - py_abi = False - if name in py_deps: - py_deps.pop(name) - elif py_abi and dist.py_version: - if name not in py_deps: - py_deps[name] = [] - spec = ('==', dist.py_version) - if spec not in py_deps[name]: - py_deps[name].append(spec) - deps = dist.requires() - if args.recommends: - depsextras = dist.requires(extras=dist.extras) - if not args.requires: - for dep in reversed(depsextras): - if dep in deps: - depsextras.remove(dep) - deps = depsextras - # console_scripts/gui_scripts entry points need pkg_resources from setuptools - if ((dist.get_entry_map('console_scripts') or - dist.get_entry_map('gui_scripts')) and - (lower.endswith('.egg') or - lower.endswith('.egg-info'))): - # stick them first so any more specific requirement overrides it - deps.insert(0, Requirement.parse('setuptools')) - # add requires/recommends based on egg/dist metadata - for dep in deps: - if args.legacy: - name = 'pythonegg({})({})'.format(pyver_major, dep.key) + + # XXX: hack to workaround RPM internal dependency generator not passing directories + lower_dir = dirname(lower) + if lower_dir.endswith('.egg') or \ + lower_dir.endswith('.egg-info') or \ + lower_dir.endswith('.dist-info'): + lower = lower_dir + f = dirname(f) + # Determine provide, requires, conflicts & recommends based on egg/dist metadata + if lower.endswith('.egg') or \ + lower.endswith('.egg-info') or \ + lower.endswith('.dist-info'): + # This import is very slow, so only do it if needed + # - Notes from an attempted rewrite from pkg_resources to + # importlib.metadata in 2020 can be found in the message of + # the commit that added this line. + from pkg_resources import Distribution, FileMetadata, PathMetadata, Requirement, parse_version + dist_name = basename(f) + if isdir(f): + path_item = dirname(f) + metadata = PathMetadata(path_item, f) + else: + path_item = f + metadata = FileMetadata(f) + dist = Distribution.from_location(path_item, dist_name, metadata) + # Check if py_version is defined in the metadata file/directory name + if not dist.py_version: + # Try to parse the Python version from the path the metadata + # resides at (e.g. /usr/lib/pythonX.Y/site-packages/...) + import re + res = re.search(r"/python(?P\d+\.\d+)/", path_item) + if res: + dist.py_version = res.group('pyver') else: - if args.majorver_only: - name = 'python{}dist({})'.format(pyver_major, dep.key) - else: - name = 'python{}dist({})'.format(dist.py_version, dep.key) - for spec in dep.specs: + warn("Version for {!r} has not been found".format(dist), RuntimeWarning) + continue + + # pkg_resources use platform.python_version to evaluate if a + # dependency is relevant based on environment markers [1], + # e.g. requirement `argparse;python_version<"2.7"` + # + # Since we're running this script on one Python version while + # possibly evaluating packages for different versions, we mock the + # platform.python_version function. Discussed upstream [2]. + # + # [1] https://www.python.org/dev/peps/pep-0508/#environment-markers + # [2] https://github.com/pypa/setuptools/pull/1275 + import platform + platform.python_version = lambda: dist.py_version + + # This is the PEP 503 normalized name. + # It does also convert dots to dashes, unlike dist.key. + # See https://bugzilla.redhat.com/show_bug.cgi?id=1791530 + normalized_name = normalize_name(dist.project_name) + + if args.majorver_provides or args.majorver_provides_versions or \ + args.majorver_only or args.legacy_provides or args.legacy: + # Get the Python major version + pyver_major = dist.py_version.split('.')[0] + if args.provides: + # If egg/dist metadata says package name is python, we provide python(abi) + if dist.key == 'python': + name = 'python(abi)' if name not in py_deps: py_deps[name] = [] + py_deps[name].append(('==', dist.py_version)) + if not args.legacy or not args.majorver_only: + if normalized_names_provide_legacy: + name = 'python{}dist({})'.format(dist.py_version, dist.key) + if name not in py_deps: + py_deps[name] = [] + if normalized_names_provide_pep503: + name_ = 'python{}dist({})'.format(dist.py_version, normalized_name) + if name_ not in py_deps: + py_deps[name_] = [] + if args.majorver_provides or args.majorver_only or \ + (args.majorver_provides_versions and dist.py_version in args.majorver_provides_versions): + if normalized_names_provide_legacy: + pymajor_name = 'python{}dist({})'.format(pyver_major, dist.key) + if pymajor_name not in py_deps: + py_deps[pymajor_name] = [] + if normalized_names_provide_pep503: + pymajor_name_ = 'python{}dist({})'.format(pyver_major, normalized_name) + if pymajor_name_ not in py_deps: + py_deps[pymajor_name_] = [] + if args.legacy or args.legacy_provides: + legacy_name = 'pythonegg({})({})'.format(pyver_major, dist.key) + if legacy_name not in py_deps: + py_deps[legacy_name] = [] + if dist.version: + version = dist.version + spec = ('==', version) + + if normalized_names_provide_legacy: + if spec not in py_deps[name]: + py_deps[name].append(spec) + if args.majorver_provides or \ + (args.majorver_provides_versions and dist.py_version in args.majorver_provides_versions): + py_deps[pymajor_name].append(spec) + if normalized_names_provide_pep503: + if spec not in py_deps[name_]: + py_deps[name_].append(spec) + if args.majorver_provides or \ + (args.majorver_provides_versions and dist.py_version in args.majorver_provides_versions): + py_deps[pymajor_name_].append(spec) + if args.legacy or args.legacy_provides: + if spec not in py_deps[legacy_name]: + py_deps[legacy_name].append(spec) + if args.requires or (args.recommends and dist.extras): + name = 'python(abi)' + # If egg/dist metadata says package name is python, we don't add dependency on python(abi) + if dist.key == 'python': + py_abi = False + if name in py_deps: + py_deps.pop(name) + elif py_abi and dist.py_version: + if name not in py_deps: + py_deps[name] = [] + spec = ('==', dist.py_version) if spec not in py_deps[name]: py_deps[name].append(spec) - if not dep.specs: - py_deps[name] = [] - # Unused, for automatic sub-package generation based on 'extras' from egg/dist metadata - # TODO: implement in rpm later, or...? - if args.extras: - deps = dist.requires() - extras = dist.extras - print(extras) - for extra in extras: - print('%%package\textras-{}'.format(extra)) - print('Summary:\t{} extra for {} python package'.format(extra, dist.key)) - print('Group:\t\tDevelopment/Python') - depsextras = dist.requires(extras=[extra]) - for dep in reversed(depsextras): - if dep in deps: - depsextras.remove(dep) - deps = depsextras + deps = dist.requires() + if args.recommends: + depsextras = dist.requires(extras=dist.extras) + if not args.requires: + for dep in reversed(depsextras): + if dep in deps: + depsextras.remove(dep) + deps = depsextras + # console_scripts/gui_scripts entry points need pkg_resources from setuptools + if ((dist.get_entry_map('console_scripts') or + dist.get_entry_map('gui_scripts')) and + (lower.endswith('.egg') or + lower.endswith('.egg-info'))): + # stick them first so any more specific requirement overrides it + deps.insert(0, Requirement.parse('setuptools')) + # add requires/recommends based on egg/dist metadata for dep in deps: - for spec in dep.specs: - if spec[0] == '!=': - print('Conflicts:\t{} {} {}'.format(dep.key, '==', spec[1])) + if normalized_names_require_pep503: + dep_normalized_name = normalize_name(dep.project_name) + else: + dep_normalized_name = dep.key + + if args.legacy: + name = 'pythonegg({})({})'.format(pyver_major, dep.key) + else: + if args.majorver_only: + name = 'python{}dist({})'.format(pyver_major, dep_normalized_name) else: - print('Requires:\t{} {} {}'.format(dep.key, spec[0], spec[1])) - print('%%description\t{}'.format(extra)) - print('{} extra for {} python package'.format(extra, dist.key)) - print('%%files\t\textras-{}\n'.format(extra)) - if args.conflicts: - # Should we really add conflicts for extras? - # Creating a meta package per extra with recommends on, which has - # the requires/conflicts in stead might be a better solution... - for dep in dist.requires(extras=dist.extras): - name = dep.key - for spec in dep.specs: - if spec[0] == '!=': + name = 'python{}dist({})'.format(dist.py_version, dep_normalized_name) + for spec in dep.specs: if name not in py_deps: py_deps[name] = [] - spec = ('==', spec[1]) if spec not in py_deps[name]: py_deps[name].append(spec) -names = list(py_deps.keys()) -names.sort() -for name in names: - if py_deps[name]: - # Print out versioned provides, requires, recommends, conflicts - spec_list = [] - for spec in py_deps[name]: - spec_list.append(convert(name, spec[0], spec[1])) - if len(spec_list) == 1: - print(spec_list[0]) + if not dep.specs: + py_deps[name] = [] + # Unused, for automatic sub-package generation based on 'extras' from egg/dist metadata + # TODO: implement in rpm later, or...? + if args.extras: + deps = dist.requires() + extras = dist.extras + print(extras) + for extra in extras: + print('%%package\textras-{}'.format(extra)) + print('Summary:\t{} extra for {} python package'.format(extra, dist.key)) + print('Group:\t\tDevelopment/Python') + depsextras = dist.requires(extras=[extra]) + for dep in reversed(depsextras): + if dep in deps: + depsextras.remove(dep) + deps = depsextras + for dep in deps: + for spec in dep.specs: + if spec[0] == '!=': + print('Conflicts:\t{} {} {}'.format(dep.key, '==', spec[1])) + else: + print('Requires:\t{} {} {}'.format(dep.key, spec[0], spec[1])) + print('%%description\t{}'.format(extra)) + print('{} extra for {} python package'.format(extra, dist.key)) + print('%%files\t\textras-{}\n'.format(extra)) + if args.conflicts: + # Should we really add conflicts for extras? + # Creating a meta package per extra with recommends on, which has + # the requires/conflicts in stead might be a better solution... + for dep in dist.requires(extras=dist.extras): + name = dep.key + for spec in dep.specs: + if spec[0] == '!=': + if name not in py_deps: + py_deps[name] = [] + spec = ('==', spec[1]) + if spec not in py_deps[name]: + py_deps[name].append(spec) + + names = list(py_deps.keys()) + names.sort() + for name in names: + if py_deps[name]: + # Print out versioned provides, requires, recommends, conflicts + spec_list = [] + for spec in py_deps[name]: + spec_list.append(convert(name, spec[0], spec[1])) + if len(spec_list) == 1: + print(spec_list[0]) + else: + # Sort spec_list so that the results can be tested easily + print('({})'.format(' with '.join(sorted(spec_list)))) else: - print('({})'.format(' with '.join(spec_list))) - else: - # Print out unversioned provides, requires, recommends, conflicts - print(name) + # Print out unversioned provides, requires, recommends, conflicts + print(name) diff --git a/tests/Makefile.am b/tests/Makefile.am index 81da85ec4d..35655b4888 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -188,7 +188,16 @@ installcheck-local: $(check_DATA) populate_testing $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir):$(rpmlibexecdir)' $(TESTSUITEFLAGS) HOME=$(abs_builddir)/testing $(KILLAGENT) ||: +check-scripts: + python3 -m pytest --ignore testing/ -vvv +TESTSUITE_PYTHONDISTDEPS = data/scripts_pythondistdeps/test-data.yaml +TESTSUITE_PYTHONDISTDEPS += data/scripts_pythondistdeps/test-requires.yaml +TESTSUITE_PYTHONDISTDEPS += data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/PKG-INFO +TESTSUITE_PYTHONDISTDEPS += data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/requires.txt +EXTRA_DIST += $(TESTSUITE_PYTHONDISTDEPS) + clean-local: test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean rm -f *.tmp rm -rf testing + rm -rf data/scripts_pythondistdeps/usr diff --git a/tests/README b/tests/README index c7423a30fd..2e7f3c3924 100644 --- a/tests/README +++ b/tests/README @@ -34,3 +34,25 @@ See for more options. But be aware some (like -j) may not work properly with the test suite unless a very restricted set of test is run. + + +Tests for pythondistdeps.py script need these Python dependencies + + - Python >= 3.6 + - pip >= 20.0.1 + - setuptools + - pytest + - pyyaml + - wheel + +to run the tests, cd into the tests directory and use + + make check-scripts + +or run directly + + python3 -m pytest --ignore testing/ + +For easier reading of the test results, see the top section of file + + tests/test_scripts_pythondistdeps.py diff --git a/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/PKG-INFO b/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/PKG-INFO new file mode 100644 index 0000000000..a99b21c108 --- /dev/null +++ b/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/PKG-INFO @@ -0,0 +1,21 @@ +Metadata-Version: 2.1 +Name: pyreq2rpm.tests +Version: 2020.04.07.024dab0 +Summary: Test package to verify conversion of dependencies from pip/python to rpm format, data taken from pyreq2rpm +Author: Tomas Orsava (author of this metapackage) +Home-page: https://github.com/gordonmessmer/pyreq2rpm +License: MIT +Description: This dist-info is mock metadata for a fictional package pyreq2rpm.tests + The important part of its contents is the requires.txt that contains + different formats of Python requirements taken from + https://github.com/gordonmessmer/pyreq2rpm, that are numbered as to be + unique. The metadata is then processed through + scripts/pythondistdeps.py and the resulting RPM requires compared to + expected results. + + The version of the package contains the date when I converted the test + data from upstream to this metapackage, as well as the short hash of + the last git commit. + + From the requirements I have omitted those that are incorrect, as they + crash the pythondistdeps.py script. diff --git a/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/requires.txt b/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/requires.txt new file mode 100644 index 0000000000..09279fba5e --- /dev/null +++ b/tests/data/scripts_pythondistdeps/pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info/requires.txt @@ -0,0 +1,102 @@ +# Taken from pyreq2rpm, removed tests that are expected to fail +foobar0~=2.4.8 +foobar1~=2.4.8.0 +foobar2~=2.4.8.1 + +foobar4~=2.0 + + +foobar7~=2.4.8b5 +foobar8~=2.0.0b5 +foobar9~=2.4.8.post1 +foobar10~=2.0.post1 +foobar11==2.4.8 +foobar12==2.4.8.0 +foobar13==2.4.8.1 +foobar14==2.4.8.* +foobar15==2.0 +foobar16==2 +foobar17==2.* +foobar18==2.4.8b5 +foobar19==2.0.0b5 +foobar20==2.4.8.post1 +foobar21==2.0.post1 +foobar22===2.4.8 +foobar23===2.4.8.0 +foobar24===2.4.8.1 + +foobar26===2.0 +foobar27===2 + +foobar29===2.4.8b5 +foobar30===2.0.0b5 +foobar31===2.4.8.post1 +foobar32===2.0.post1 +foobar33!=2.4.8 +foobar34!=2.4.8.0 +foobar35!=2.4.8.1 +foobar36!=2.4.8.* +foobar37!=2.0 +foobar38!=2 +foobar39!=2.* +foobar40!=2.4.8b5 +foobar41!=2.0.0b5 +foobar42!=2.4.8.post1 +foobar43!=2.0.post1 +foobar44<=2.4.8 +foobar45<=2.4.8.0 +foobar46<=2.4.8.1 +foobar47<=2.4.8.* +foobar48<=2.0 +foobar49<=2 +foobar50<=2.* +foobar51<=2.4.8b5 +foobar52<=2.0.0b5 +foobar53<=2.4.8.post1 +foobar54<=2.0.post1 +foobar55<2.4.8 +foobar56<2.4.8.0 +foobar57<2.4.8.1 +foobar58<2.4.8.* +foobar59<2.0 +foobar60<2 +foobar61<2.* +foobar62<2.4.8b5 +foobar63<2.0.0b5 +foobar64<2.4.8.post1 +foobar65<2.0.post1 +foobar66>=2.4.8 +foobar67>=2.4.8.0 +foobar68>=2.4.8.1 +foobar69>=2.4.8.* +foobar70>=2.0 +foobar71>=2 +foobar72>=2.* +foobar73>=2.4.8b5 +foobar74>=2.0.0b5 +foobar75>=2.4.8.post1 +foobar76>=2.0.post1 +foobar77>2.4.8 +foobar78>2.4.8.0 +foobar79>2.4.8.1 +foobar80>2.4.8.* +foobar81>2.0 +foobar82>2 +foobar83>2.* +foobar84>2.4.8b5 +foobar85>2.0.0b5 +foobar86>2.4.8.post1 +foobar87>2.0.post1 +pyparsing0 +pyparsing1>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6 +babel>=1.3,!=2.0 + +# Tests for breakages in Fedora +fedora-python-nb2plots==0+unknown + +# Other tests +hugo1==1.0.0.dev7 +hugo2<=8a4 +hugo3!=11.1.1b14 +hugo4>11rc0 +hugo5===11.1.0.post3 diff --git a/tests/data/scripts_pythondistdeps/test-data.yaml b/tests/data/scripts_pythondistdeps/test-data.yaml new file mode 100644 index 0000000000..9722688901 --- /dev/null +++ b/tests/data/scripts_pythondistdeps/test-data.yaml @@ -0,0 +1,1217 @@ +--requires: + --provides: + pyreq2rpm.tests-2020.04.07.024dab0-py3.9.egg-info: + provides: python3.9dist(pyreq2rpm.tests) = 2020.04.07.024dab0 + requires: |- + python(abi) = 3.9 + ((python3.9dist(babel) < 2 or python3.9dist(babel) > 2) with python3.9dist(babel) >= 1.3) + python3.9dist(fedora-python-nb2plots) = 0 + (python3.9dist(foobar0) >= 2.4.8 with python3.9dist(foobar0) < 2.5) + (python3.9dist(foobar1) >= 2.4.8 with python3.9dist(foobar1) < 2.4.9) + (python3.9dist(foobar10) >= 2^post1 with python3.9dist(foobar10) < 3) + python3.9dist(foobar11) = 2.4.8 + python3.9dist(foobar12) = 2.4.8 + python3.9dist(foobar13) = 2.4.8.1 + (python3.9dist(foobar14) >= 2.4.8 with python3.9dist(foobar14) < 2.4.9) + python3.9dist(foobar15) = 2 + python3.9dist(foobar16) = 2 + (python3.9dist(foobar17) >= 2 with python3.9dist(foobar17) < 3) + python3.9dist(foobar18) = 2.4.8~b5 + python3.9dist(foobar19) = 2~b5 + (python3.9dist(foobar2) >= 2.4.8.1 with python3.9dist(foobar2) < 2.4.9) + python3.9dist(foobar20) = 2.4.8^post1 + python3.9dist(foobar21) = 2^post1 + python3.9dist(foobar22) = 2.4.8 + python3.9dist(foobar23) = 2.4.8 + python3.9dist(foobar24) = 2.4.8.1 + python3.9dist(foobar26) = 2 + python3.9dist(foobar27) = 2 + python3.9dist(foobar29) = 2.4.8~b5 + python3.9dist(foobar30) = 2~b5 + python3.9dist(foobar31) = 2.4.8^post1 + python3.9dist(foobar32) = 2^post1 + (python3.9dist(foobar33) < 2.4.8 or python3.9dist(foobar33) > 2.4.8) + (python3.9dist(foobar34) < 2.4.8 or python3.9dist(foobar34) > 2.4.8) + (python3.9dist(foobar35) < 2.4.8.1 or python3.9dist(foobar35) > 2.4.8.1) + (python3.9dist(foobar36) < 2.4.8 or python3.9dist(foobar36) > 2.4.9) + (python3.9dist(foobar37) < 2 or python3.9dist(foobar37) > 2) + (python3.9dist(foobar38) < 2 or python3.9dist(foobar38) > 2) + (python3.9dist(foobar39) < 2 or python3.9dist(foobar39) > 3) + (python3.9dist(foobar4) >= 2 with python3.9dist(foobar4) < 3) + (python3.9dist(foobar40) < 2.4.8~b5 or python3.9dist(foobar40) > 2.4.8~b5) + (python3.9dist(foobar41) < 2~b5 or python3.9dist(foobar41) > 2~b5) + (python3.9dist(foobar42) < 2.4.8^post1 or python3.9dist(foobar42) > 2.4.8^post1) + (python3.9dist(foobar43) < 2^post1 or python3.9dist(foobar43) > 2^post1) + python3.9dist(foobar44) <= 2.4.8 + python3.9dist(foobar45) <= 2.4.8 + python3.9dist(foobar46) <= 2.4.8.1 + python3.9dist(foobar47) <= 2.4.8 + python3.9dist(foobar48) <= 2 + python3.9dist(foobar49) <= 2 + python3.9dist(foobar50) <= 2 + python3.9dist(foobar51) <= 2.4.8~b5 + python3.9dist(foobar52) <= 2~b5 + python3.9dist(foobar53) <= 2.4.8^post1 + python3.9dist(foobar54) <= 2^post1 + python3.9dist(foobar55) < 2.4.8 + python3.9dist(foobar56) < 2.4.8 + python3.9dist(foobar57) < 2.4.8.1 + python3.9dist(foobar58) < 2.4.8 + python3.9dist(foobar59) < 2 + python3.9dist(foobar60) < 2 + python3.9dist(foobar61) < 2 + python3.9dist(foobar62) < 2.4.8~b5 + python3.9dist(foobar63) < 2~b5 + python3.9dist(foobar64) < 2.4.8^post1 + python3.9dist(foobar65) < 2^post1 + python3.9dist(foobar66) >= 2.4.8 + python3.9dist(foobar67) >= 2.4.8 + python3.9dist(foobar68) >= 2.4.8.1 + python3.9dist(foobar69) >= 2.4.8 + (python3.9dist(foobar7) >= 2.4.8~b5 with python3.9dist(foobar7) < 2.5) + python3.9dist(foobar70) >= 2 + python3.9dist(foobar71) >= 2 + python3.9dist(foobar72) >= 2 + python3.9dist(foobar73) >= 2.4.8~b5 + python3.9dist(foobar74) >= 2~b5 + python3.9dist(foobar75) >= 2.4.8^post1 + python3.9dist(foobar76) >= 2^post1 + python3.9dist(foobar77) > 2.4.8 + python3.9dist(foobar78) > 2.4.8 + python3.9dist(foobar79) > 2.4.8.1 + (python3.9dist(foobar8) >= 2~b5 with python3.9dist(foobar8) < 2.1) + python3.9dist(foobar80) >= 2.4.9 + python3.9dist(foobar81) > 2 + python3.9dist(foobar82) > 2 + python3.9dist(foobar83) >= 3 + python3.9dist(foobar84) > 2.4.8~b5 + python3.9dist(foobar85) > 2~b5 + python3.9dist(foobar86) > 2.4.8^post1 + python3.9dist(foobar87) > 2^post1 + (python3.9dist(foobar9) >= 2.4.8^post1 with python3.9dist(foobar9) < 2.5) + python3.9dist(hugo1) = 1~~dev7 + python3.9dist(hugo2) <= 8~a4 + (python3.9dist(hugo3) < 11.1.1~b14 or python3.9dist(hugo3) > 11.1.1~b14) + python3.9dist(hugo4) > 11~rc0 + python3.9dist(hugo5) = 11.1^post3 + python3.9dist(pyparsing0) + ((python3.9dist(pyparsing1) < 2.0.4 or python3.9dist(pyparsing1) > 2.0.4) with (python3.9dist(pyparsing1) < 2.1.2 or python3.9dist(pyparsing1) > 2.1.2) with (python3.9dist(pyparsing1) < 2.1.6 or python3.9dist(pyparsing1) > 2.1.6) with python3.9dist(pyparsing1) >= 2.0.1) + usr/lib/python3.9/site-packages/taskotron_python_versions-0.1.dev6.dist-info: + provides: python3.9dist(taskotron-python-versions) = 0.1~~dev6 + requires: |- + python(abi) = 3.9 + python3.9dist(libarchive-c) + python3.9dist(python-bugzilla) + --provides --majorver-provides: + usr/lib/python2.7/site-packages/attrs-19.1.0-py2.7.egg-info: + provides: |- + python2.7dist(attrs) = 19.1 + python2dist(attrs) = 19.1 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/kubernetes-11.0.0b2.dist-info: + provides: |- + python2.7dist(kubernetes) = 11~b2 + python2dist(kubernetes) = 11~b2 + requires: |- + python(abi) = 2.7 + python2.7dist(certifi) >= 14.5.14 + python2.7dist(google-auth) >= 1.0.1 + python2.7dist(ipaddress) >= 1.0.17 + python2.7dist(python-dateutil) >= 2.5.3 + python2.7dist(pyyaml) >= 3.12 + python2.7dist(requests) + python2.7dist(requests-oauthlib) + python2.7dist(setuptools) >= 21 + python2.7dist(six) >= 1.9 + python2.7dist(urllib3) >= 1.24.2 + ((python2.7dist(websocket-client) < 0.40 or python2.7dist(websocket-client) > 0.40) with (python2.7dist(websocket-client) < 0.41 or python2.7dist(websocket-client) > 0.42) with (python2.7dist(websocket-client) < 0.42 or python2.7dist(websocket-client) > 0.43) with python2.7dist(websocket-client) >= 0.32) + usr/lib/python2.7/site-packages/mistune-0.8.4-py2.7.egg-info: + provides: |- + python2.7dist(mistune) = 0.8.4 + python2dist(mistune) = 0.8.4 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/packaging-19.0.dist-info: + provides: |- + python2.7dist(packaging) = 19 + python2dist(packaging) = 19 + requires: |- + python(abi) = 2.7 + python2.7dist(pyparsing) >= 2.0.2 + python2.7dist(six) + usr/lib/python2.7/site-packages/pip-19.1.1.dist-info: + provides: |- + python2.7dist(pip) = 19.1.1 + python2dist(pip) = 19.1.1 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/pyparsing-2.4.0.dist-info: + provides: |- + python2.7dist(pyparsing) = 2.4 + python2dist(pyparsing) = 2.4 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/setuptools-41.6.0-py2.7.egg-info: + provides: |- + python2.7dist(setuptools) = 41.6 + python2dist(setuptools) = 41.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/setuptools-41.6.0.dist-info: + provides: |- + python2.7dist(setuptools) = 41.6 + python2dist(setuptools) = 41.6 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/six-1.12.0.dist-info: + provides: |- + python2.7dist(six) = 1.12 + python2dist(six) = 1.12 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/tox-3.14.0.dist-info: + provides: |- + python2.7dist(tox) = 3.14 + python2dist(tox) = 3.14 + requires: |- + python(abi) = 2.7 + (python2.7dist(filelock) < 4 with python2.7dist(filelock) >= 3) + (python2.7dist(importlib-metadata) < 1 with python2.7dist(importlib-metadata) >= 0.12) + python2.7dist(packaging) >= 14 + (python2.7dist(pluggy) < 1 with python2.7dist(pluggy) >= 0.12) + (python2.7dist(py) < 2 with python2.7dist(py) >= 1.4.17) + (python2.7dist(six) < 2 with python2.7dist(six) >= 1) + python2.7dist(toml) >= 0.9.4 + python2.7dist(virtualenv) >= 14 + usr/lib/python2.7/site-packages/urllib3-1.25.7-py2.7.egg-info: + provides: |- + python2.7dist(urllib3) = 1.25.7 + python2dist(urllib3) = 1.25.7 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope.component) = 4.3 + python2dist(zope.component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 4.1 + usr/lib/python3.7/site-packages/astroid-2.3.3.dist-info: + provides: |- + python3.7dist(astroid) = 2.3.3 + python3dist(astroid) = 2.3.3 + requires: |- + python(abi) = 3.7 + (python3.7dist(lazy-object-proxy) >= 1.4 with python3.7dist(lazy-object-proxy) < 1.5) + (python3.7dist(six) >= 1.12 with python3.7dist(six) < 2) + (python3.7dist(typed-ast) < 1.5 with python3.7dist(typed-ast) >= 1.4) + (python3.7dist(wrapt) >= 1.11 with python3.7dist(wrapt) < 1.12) + usr/lib/python3.7/site-packages/packaging-19.0.dist-info: + provides: |- + python3.7dist(packaging) = 19 + python3dist(packaging) = 19 + requires: |- + python(abi) = 3.7 + python3.7dist(pyparsing) >= 2.0.2 + python3.7dist(six) + usr/lib/python3.7/site-packages/pip-19.1.1.dist-info: + provides: |- + python3.7dist(pip) = 19.1.1 + python3dist(pip) = 19.1.1 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/pyparsing-2.4.0.dist-info: + provides: |- + python3.7dist(pyparsing) = 2.4 + python3dist(pyparsing) = 2.4 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/setuptools-41.6.0-py3.7.egg-info: + provides: |- + python3.7dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.7 + python3.7dist(setuptools) + usr/lib/python3.7/site-packages/setuptools-41.6.0.dist-info: + provides: |- + python3.7dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/six-1.12.0.dist-info: + provides: |- + python3.7dist(six) = 1.12 + python3dist(six) = 1.12 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/tox-3.14.0.dist-info: + provides: |- + python3.7dist(tox) = 3.14 + python3dist(tox) = 3.14 + requires: |- + python(abi) = 3.7 + (python3.7dist(filelock) < 4 with python3.7dist(filelock) >= 3) + (python3.7dist(importlib-metadata) < 1 with python3.7dist(importlib-metadata) >= 0.12) + python3.7dist(packaging) >= 14 + (python3.7dist(pluggy) < 1 with python3.7dist(pluggy) >= 0.12) + (python3.7dist(py) < 2 with python3.7dist(py) >= 1.4.17) + (python3.7dist(six) < 2 with python3.7dist(six) >= 1) + python3.7dist(toml) >= 0.9.4 + python3.7dist(virtualenv) >= 14 + usr/lib/python3.9/site-packages/astroid-2.3.3.dist-info: + provides: |- + python3.9dist(astroid) = 2.3.3 + python3dist(astroid) = 2.3.3 + requires: |- + python(abi) = 3.9 + (python3.9dist(lazy-object-proxy) >= 1.4 with python3.9dist(lazy-object-proxy) < 1.5) + (python3.9dist(six) >= 1.12 with python3.9dist(six) < 2) + (python3.9dist(wrapt) >= 1.11 with python3.9dist(wrapt) < 1.12) + usr/lib/python3.9/site-packages/attrs-19.1.0-py3.9.egg-info: + provides: |- + python3.9dist(attrs) = 19.1 + python3dist(attrs) = 19.1 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/fsleyes-0.32.3.dist-info: + provides: |- + python3.9dist(fsleyes) = 0.32.3 + python3dist(fsleyes) = 0.32.3 + requires: |- + python(abi) = 3.9 + python3.9dist(fsleyes-props) >= 1.6.7 + python3.9dist(fsleyes-widgets) >= 0.8.4 + python3.9dist(fslpy) >= 2.8.4 + (python3.9dist(jinja2) >= 2 with python3.9dist(jinja2) < 3) + python3.9dist(matplotlib) >= 1.5.1 + python3.9dist(nibabel) >= 2.3 + python3.9dist(numpy) >= 1.14 + python3.9dist(pillow) >= 3.2 + python3.9dist(pyopengl) >= 3.1 + (python3.9dist(pyparsing) >= 2 with python3.9dist(pyparsing) < 3) + python3.9dist(scipy) >= 0.18 + python3.9dist(setuptools) + (python3.9dist(six) >= 1 with python3.9dist(six) < 2) + python3.9dist(wxpython) >= 3.0.2 + usr/lib/python3.9/site-packages/kubernetes-11.0.0.dist-info: + provides: |- + python3.9dist(kubernetes) = 11 + python3dist(kubernetes) = 11 + requires: |- + python(abi) = 3.9 + python3.9dist(certifi) >= 14.5.14 + python3.9dist(google-auth) >= 1.0.1 + python3.9dist(python-dateutil) >= 2.5.3 + python3.9dist(pyyaml) >= 3.12 + python3.9dist(requests) + python3.9dist(requests-oauthlib) + python3.9dist(setuptools) >= 21 + python3.9dist(six) >= 1.9 + python3.9dist(urllib3) >= 1.24.2 + ((python3.9dist(websocket-client) < 0.40 or python3.9dist(websocket-client) > 0.40) with (python3.9dist(websocket-client) < 0.41 or python3.9dist(websocket-client) > 0.42) with (python3.9dist(websocket-client) < 0.42 or python3.9dist(websocket-client) > 0.43) with python3.9dist(websocket-client) >= 0.32) + usr/lib/python3.9/site-packages/mistune-0.8.4-py3.9.egg-info: + provides: |- + python3.9dist(mistune) = 0.8.4 + python3dist(mistune) = 0.8.4 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/packaging-20.1.dist-info: + provides: |- + python3.9dist(packaging) = 20.1 + python3dist(packaging) = 20.1 + requires: |- + python(abi) = 3.9 + python3.9dist(pyparsing) >= 2.0.2 + python3.9dist(six) + usr/lib/python3.9/site-packages/pip-20.0.2.dist-info: + provides: |- + python3.9dist(pip) = 20.0.2 + python3dist(pip) = 20.0.2 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/pyparsing-2.4.0.dist-info: + provides: |- + python3.9dist(pyparsing) = 2.4 + python3dist(pyparsing) = 2.4 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/setuptools-41.6.0-py3.9.egg-info: + provides: |- + python3.9dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/setuptools-41.6.0.dist-info: + provides: |- + python3.9dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/six-1.12.0.dist-info: + provides: |- + python3.9dist(six) = 1.12 + python3dist(six) = 1.12 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/taskotron_python_versions-0.1.dev6.dist-info: + provides: |- + python3.9dist(taskotron-python-versions) = 0.1~~dev6 + python3dist(taskotron-python-versions) = 0.1~~dev6 + requires: |- + python(abi) = 3.9 + python3.9dist(libarchive-c) + python3.9dist(python-bugzilla) + usr/lib/python3.9/site-packages/tox-3.14.0.dist-info: + provides: |- + python3.9dist(tox) = 3.14 + python3dist(tox) = 3.14 + requires: |- + python(abi) = 3.9 + (python3.9dist(filelock) < 4 with python3.9dist(filelock) >= 3) + python3.9dist(packaging) >= 14 + (python3.9dist(pluggy) < 1 with python3.9dist(pluggy) >= 0.12) + (python3.9dist(py) < 2 with python3.9dist(py) >= 1.4.17) + (python3.9dist(six) < 2 with python3.9dist(six) >= 1) + python3.9dist(toml) >= 0.9.4 + python3.9dist(virtualenv) >= 14 + usr/lib/python3.9/site-packages/urllib3-1.25.7-py3.9.egg-info: + provides: |- + python3.9dist(urllib3) = 1.25.7 + python3dist(urllib3) = 1.25.7 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope.schema) = 4.4.2 + python3dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 3.6 + usr/lib64/python2.7/site-packages/MarkupSafe-1.1.1.dist-info: + provides: |- + python2.7dist(markupsafe) = 1.1.1 + python2dist(markupsafe) = 1.1.1 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports.range) = 3.7.2 + python2dist(backports.range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/lxml-4.4.0.dist-info: + provides: |- + python2.7dist(lxml) = 4.4 + python2dist(lxml) = 4.4 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/numpy-1.16.4.dist-info: + provides: |- + python2.7dist(numpy) = 1.16.4 + python2dist(numpy) = 1.16.4 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/numpy_stl-2.11.2-py2.7.egg-info: + provides: |- + python2.7dist(numpy-stl) = 2.11.2 + python2dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 2.7 + python2.7dist(numpy) + python2.7dist(python-utils) >= 1.6.2 + python2.7dist(setuptools) + usr/lib64/python2.7/site-packages/scipy-1.2.1.dist-info: + provides: |- + python2.7dist(scipy) = 1.2.1 + python2dist(scipy) = 1.2.1 + requires: |- + python(abi) = 2.7 + python2.7dist(numpy) >= 1.8.2 + usr/lib64/python2.7/site-packages/simplejson-3.16.0-py2.7.egg-info: + provides: |- + python2.7dist(simplejson) = 3.16 + python2dist(simplejson) = 3.16 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/MarkupSafe-1.1.1.dist-info: + provides: |- + python3.7dist(markupsafe) = 1.1.1 + python3dist(markupsafe) = 1.1.1 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/PyQt5_sip-4.19.19.dist-info: + provides: |- + python3.7dist(pyqt5-sip) = 4.19.19 + python3dist(pyqt5-sip) = 4.19.19 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/PyQtWebEngine-5.12.1.dist-info: + provides: |- + python3.7dist(pyqtwebengine) = 5.12.1 + python3dist(pyqtwebengine) = 5.12.1 + requires: |- + python(abi) = 3.7 + python3.7dist(pyqt5) >= 5.12 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: |- + python3.7dist(backports.range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/lxml-4.4.0.dist-info: + provides: |- + python3.7dist(lxml) = 4.4 + python3dist(lxml) = 4.4 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/numpy-1.17.4.dist-info: + provides: |- + python3.7dist(numpy) = 1.17.4 + python3dist(numpy) = 1.17.4 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/numpy_stl-2.11.2-py3.7.egg-info: + provides: |- + python3.7dist(numpy-stl) = 2.11.2 + python3dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 3.7 + python3.7dist(numpy) + python3.7dist(python-utils) >= 1.6.2 + python3.7dist(setuptools) + usr/lib64/python3.7/site-packages/scipy-1.2.1.dist-info: + provides: |- + python3.7dist(scipy) = 1.2.1 + python3dist(scipy) = 1.2.1 + requires: |- + python(abi) = 3.7 + python3.7dist(numpy) >= 1.8.2 + usr/lib64/python3.7/site-packages/simplejson-3.16.0-py3.7.egg-info: + provides: |- + python3.7dist(simplejson) = 3.16 + python3dist(simplejson) = 3.16 + requires: python(abi) = 3.7 + usr/lib64/python3.9/site-packages/PyQtWebEngine-5.12.1.dist-info: + provides: |- + python3.9dist(pyqtwebengine) = 5.12.1 + python3dist(pyqtwebengine) = 5.12.1 + requires: |- + python(abi) = 3.9 + python3.9dist(pyqt5) >= 5.12 + usr/lib64/python3.9/site-packages/backports.range-3.7.2-py3.9.egg-info: + provides: |- + python3.9dist(backports.range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.9 + usr/lib64/python3.9/site-packages/numpy_stl-2.11.2-py3.9.egg-info: + provides: |- + python3.9dist(numpy-stl) = 2.11.2 + python3dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 3.9 + python3.9dist(numpy) + python3.9dist(python-utils) >= 1.6.2 + python3.9dist(setuptools) + usr/lib64/python3.9/site-packages/simplejson-3.16.0-py3.9.egg-info: + provides: |- + python3.9dist(simplejson) = 3.16 + python3dist(simplejson) = 3.16 + requires: python(abi) = 3.9 + --provides --majorver-provides-versions 3.9 --majorver-provides-versions 2.7: + usr/lib/python2.7/site-packages/attrs-19.1.0-py2.7.egg-info: + provides: |- + python2.7dist(attrs) = 19.1 + python2dist(attrs) = 19.1 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/kubernetes-11.0.0b2.dist-info: + provides: |- + python2.7dist(kubernetes) = 11~b2 + python2dist(kubernetes) = 11~b2 + requires: |- + python(abi) = 2.7 + python2.7dist(certifi) >= 14.5.14 + python2.7dist(google-auth) >= 1.0.1 + python2.7dist(ipaddress) >= 1.0.17 + python2.7dist(python-dateutil) >= 2.5.3 + python2.7dist(pyyaml) >= 3.12 + python2.7dist(requests) + python2.7dist(requests-oauthlib) + python2.7dist(setuptools) >= 21 + python2.7dist(six) >= 1.9 + python2.7dist(urllib3) >= 1.24.2 + ((python2.7dist(websocket-client) < 0.40 or python2.7dist(websocket-client) > 0.40) with (python2.7dist(websocket-client) < 0.41 or python2.7dist(websocket-client) > 0.42) with (python2.7dist(websocket-client) < 0.42 or python2.7dist(websocket-client) > 0.43) with python2.7dist(websocket-client) >= 0.32) + usr/lib/python2.7/site-packages/mistune-0.8.4-py2.7.egg-info: + provides: |- + python2.7dist(mistune) = 0.8.4 + python2dist(mistune) = 0.8.4 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/packaging-19.0.dist-info: + provides: |- + python2.7dist(packaging) = 19 + python2dist(packaging) = 19 + requires: |- + python(abi) = 2.7 + python2.7dist(pyparsing) >= 2.0.2 + python2.7dist(six) + usr/lib/python2.7/site-packages/pip-19.1.1.dist-info: + provides: |- + python2.7dist(pip) = 19.1.1 + python2dist(pip) = 19.1.1 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/pyparsing-2.4.0.dist-info: + provides: |- + python2.7dist(pyparsing) = 2.4 + python2dist(pyparsing) = 2.4 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/setuptools-41.6.0-py2.7.egg-info: + provides: |- + python2.7dist(setuptools) = 41.6 + python2dist(setuptools) = 41.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/setuptools-41.6.0.dist-info: + provides: |- + python2.7dist(setuptools) = 41.6 + python2dist(setuptools) = 41.6 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/six-1.12.0.dist-info: + provides: |- + python2.7dist(six) = 1.12 + python2dist(six) = 1.12 + requires: python(abi) = 2.7 + usr/lib/python3.11/site-packages/pip-20.0.2-py3.11.egg-info: + provides: python3.11dist(pip) = 20.0.2 + requires: |- + python(abi) = 3.11 + python3.11dist(setuptools) + usr/lib/python3.7/site-packages/astroid-2.3.3.dist-info: + provides: python3.7dist(astroid) = 2.3.3 + requires: |- + python(abi) = 3.7 + (python3.7dist(lazy-object-proxy) >= 1.4 with python3.7dist(lazy-object-proxy) < 1.5) + (python3.7dist(six) >= 1.12 with python3.7dist(six) < 2) + (python3.7dist(typed-ast) < 1.5 with python3.7dist(typed-ast) >= 1.4) + (python3.7dist(wrapt) >= 1.11 with python3.7dist(wrapt) < 1.12) + usr/lib/python3.7/site-packages/packaging-19.0.dist-info: + provides: python3.7dist(packaging) = 19 + requires: |- + python(abi) = 3.7 + python3.7dist(pyparsing) >= 2.0.2 + python3.7dist(six) + usr/lib/python3.7/site-packages/pip-19.1.1.dist-info: + provides: python3.7dist(pip) = 19.1.1 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/pyparsing-2.4.0.dist-info: + provides: python3.7dist(pyparsing) = 2.4 + requires: python(abi) = 3.7 + usr/lib/python3.9/site-packages/attrs-19.1.0-py3.9.egg-info: + provides: |- + python3.9dist(attrs) = 19.1 + python3dist(attrs) = 19.1 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/mistune-0.8.4-py3.9.egg-info: + provides: |- + python3.9dist(mistune) = 0.8.4 + python3dist(mistune) = 0.8.4 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/packaging-20.1.dist-info: + provides: |- + python3.9dist(packaging) = 20.1 + python3dist(packaging) = 20.1 + requires: |- + python(abi) = 3.9 + python3.9dist(pyparsing) >= 2.0.2 + python3.9dist(six) + usr/lib/python3.9/site-packages/pip-20.0.2.dist-info: + provides: |- + python3.9dist(pip) = 20.0.2 + python3dist(pip) = 20.0.2 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/pyparsing-2.4.0.dist-info: + provides: |- + python3.9dist(pyparsing) = 2.4 + python3dist(pyparsing) = 2.4 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/setuptools-41.6.0-py3.9.egg-info: + provides: |- + python3.9dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/setuptools-41.6.0.dist-info: + provides: |- + python3.9dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/six-1.12.0.dist-info: + provides: |- + python3.9dist(six) = 1.12 + python3dist(six) = 1.12 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/tox-3.14.0.dist-info: + provides: |- + python3.9dist(tox) = 3.14 + python3dist(tox) = 3.14 + requires: |- + python(abi) = 3.9 + (python3.9dist(filelock) < 4 with python3.9dist(filelock) >= 3) + python3.9dist(packaging) >= 14 + (python3.9dist(pluggy) < 1 with python3.9dist(pluggy) >= 0.12) + (python3.9dist(py) < 2 with python3.9dist(py) >= 1.4.17) + (python3.9dist(six) < 2 with python3.9dist(six) >= 1) + python3.9dist(toml) >= 0.9.4 + python3.9dist(virtualenv) >= 14 + usr/lib/python3.9/site-packages/urllib3-1.25.7-py3.9.egg-info: + provides: |- + python3.9dist(urllib3) = 1.25.7 + python3dist(urllib3) = 1.25.7 + requires: python(abi) = 3.9 + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope.schema) = 4.4.2 + python3dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 3.6 + usr/lib64/python2.7/site-packages/MarkupSafe-1.1.1.dist-info: + provides: |- + python2.7dist(markupsafe) = 1.1.1 + python2dist(markupsafe) = 1.1.1 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports.range) = 3.7.2 + python2dist(backports.range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/lxml-4.4.0.dist-info: + provides: |- + python2.7dist(lxml) = 4.4 + python2dist(lxml) = 4.4 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/numpy-1.16.4.dist-info: + provides: |- + python2.7dist(numpy) = 1.16.4 + python2dist(numpy) = 1.16.4 + requires: python(abi) = 2.7 + usr/lib64/python2.7/site-packages/numpy_stl-2.11.2-py2.7.egg-info: + provides: |- + python2.7dist(numpy-stl) = 2.11.2 + python2dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 2.7 + python2.7dist(numpy) + python2.7dist(python-utils) >= 1.6.2 + python2.7dist(setuptools) + --provides --majorver-provides-versions 3.9,2.7: + usr/lib/python2.7/site-packages/tox-3.14.0.dist-info: + provides: |- + python2.7dist(tox) = 3.14 + python2dist(tox) = 3.14 + requires: |- + python(abi) = 2.7 + (python2.7dist(filelock) < 4 with python2.7dist(filelock) >= 3) + (python2.7dist(importlib-metadata) < 1 with python2.7dist(importlib-metadata) >= 0.12) + python2.7dist(packaging) >= 14 + (python2.7dist(pluggy) < 1 with python2.7dist(pluggy) >= 0.12) + (python2.7dist(py) < 2 with python2.7dist(py) >= 1.4.17) + (python2.7dist(six) < 2 with python2.7dist(six) >= 1) + python2.7dist(toml) >= 0.9.4 + python2.7dist(virtualenv) >= 14 + usr/lib/python2.7/site-packages/urllib3-1.25.7-py2.7.egg-info: + provides: |- + python2.7dist(urllib3) = 1.25.7 + python2dist(urllib3) = 1.25.7 + requires: python(abi) = 2.7 + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope.component) = 4.3 + python2dist(zope.component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 4.1 + usr/lib/python3.10/site-packages/setuptools-41.6.0-py3.10.egg-info: + provides: python3.10dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.10 + python3.10dist(setuptools) + usr/lib/python3.7/site-packages/setuptools-41.6.0-py3.7.egg-info: + provides: python3.7dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.7 + python3.7dist(setuptools) + usr/lib/python3.7/site-packages/setuptools-41.6.0.dist-info: + provides: python3.7dist(setuptools) = 41.6 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/six-1.12.0.dist-info: + provides: python3.7dist(six) = 1.12 + requires: python(abi) = 3.7 + usr/lib/python3.7/site-packages/tox-3.14.0.dist-info: + provides: python3.7dist(tox) = 3.14 + requires: |- + python(abi) = 3.7 + (python3.7dist(filelock) < 4 with python3.7dist(filelock) >= 3) + (python3.7dist(importlib-metadata) < 1 with python3.7dist(importlib-metadata) >= 0.12) + python3.7dist(packaging) >= 14 + (python3.7dist(pluggy) < 1 with python3.7dist(pluggy) >= 0.12) + (python3.7dist(py) < 2 with python3.7dist(py) >= 1.4.17) + (python3.7dist(six) < 2 with python3.7dist(six) >= 1) + python3.7dist(toml) >= 0.9.4 + python3.7dist(virtualenv) >= 14 + usr/lib64/python2.7/site-packages/scipy-1.2.1.dist-info: + provides: |- + python2.7dist(scipy) = 1.2.1 + python2dist(scipy) = 1.2.1 + requires: |- + python(abi) = 2.7 + python2.7dist(numpy) >= 1.8.2 + usr/lib64/python2.7/site-packages/simplejson-3.16.0-py2.7.egg-info: + provides: |- + python2.7dist(simplejson) = 3.16 + python2dist(simplejson) = 3.16 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/MarkupSafe-1.1.1.dist-info: + provides: python3.7dist(markupsafe) = 1.1.1 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/PyQt5_sip-4.19.19.dist-info: + provides: python3.7dist(pyqt5-sip) = 4.19.19 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/PyQtWebEngine-5.12.1.dist-info: + provides: python3.7dist(pyqtwebengine) = 5.12.1 + requires: |- + python(abi) = 3.7 + python3.7dist(pyqt5) >= 5.12 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: python3.7dist(backports.range) = 3.7.2 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/lxml-4.4.0.dist-info: + provides: python3.7dist(lxml) = 4.4 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/numpy-1.17.4.dist-info: + provides: python3.7dist(numpy) = 1.17.4 + requires: python(abi) = 3.7 + usr/lib64/python3.7/site-packages/numpy_stl-2.11.2-py3.7.egg-info: + provides: python3.7dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 3.7 + python3.7dist(numpy) + python3.7dist(python-utils) >= 1.6.2 + python3.7dist(setuptools) + usr/lib64/python3.7/site-packages/scipy-1.2.1.dist-info: + provides: python3.7dist(scipy) = 1.2.1 + requires: |- + python(abi) = 3.7 + python3.7dist(numpy) >= 1.8.2 + usr/lib64/python3.7/site-packages/simplejson-3.16.0-py3.7.egg-info: + provides: python3.7dist(simplejson) = 3.16 + requires: python(abi) = 3.7 + usr/lib64/python3.9/site-packages/PyQtWebEngine-5.12.1.dist-info: + provides: |- + python3.9dist(pyqtwebengine) = 5.12.1 + python3dist(pyqtwebengine) = 5.12.1 + requires: |- + python(abi) = 3.9 + python3.9dist(pyqt5) >= 5.12 + usr/lib64/python3.9/site-packages/backports.range-3.7.2-py3.9.egg-info: + provides: |- + python3.9dist(backports.range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.9 + usr/lib64/python3.9/site-packages/numpy_stl-2.11.2-py3.9.egg-info: + provides: |- + python3.9dist(numpy-stl) = 2.11.2 + python3dist(numpy-stl) = 2.11.2 + requires: |- + python(abi) = 3.9 + python3.9dist(numpy) + python3.9dist(python-utils) >= 1.6.2 + python3.9dist(setuptools) + usr/lib64/python3.9/site-packages/simplejson-3.16.0-py3.9.egg-info: + provides: |- + python3.9dist(simplejson) = 3.16 + python3dist(simplejson) = 3.16 + requires: python(abi) = 3.9 + --provides --majorver-provides-versions 3.9,2.7 --majorver-provides-versions 3.10: + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope.interface) = 4.6 + python2dist(zope.interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python3.10/site-packages/setuptools-41.6.0-py3.10.egg-info: + provides: |- + python3.10dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.10 + python3.10dist(setuptools) + usr/lib/python3.11/site-packages/pip-20.0.2-py3.11.egg-info: + provides: python3.11dist(pip) = 20.0.2 + requires: |- + python(abi) = 3.11 + python3.11dist(setuptools) + usr/lib64/python3.7/site-packages/lxml-4.4.0.dist-info: + provides: python3.7dist(lxml) = 4.4 + requires: python(abi) = 3.7 + usr/lib64/python3.9/site-packages/simplejson-3.16.0-py3.9.egg-info: + provides: |- + python3.9dist(simplejson) = 3.16 + python3dist(simplejson) = 3.16 + requires: python(abi) = 3.9 + --provides --majorver-provides-versions 3.9: + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope.interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib64/python3.7/site-packages/lxml-4.4.0.dist-info: + provides: python3.7dist(lxml) = 4.4 + requires: python(abi) = 3.7 + usr/lib64/python3.9/site-packages/simplejson-3.16.0-py3.9.egg-info: + provides: |- + python3.9dist(simplejson) = 3.16 + python3dist(simplejson) = 3.16 + requires: python(abi) = 3.9 +--requires --normalized-names-format legacy-dots: + --provides --majorver-provides --normalized-names-format legacy-dots: + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope.component) = 4.3 + python2dist(zope.component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 4.1 + usr/lib/python2.7/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python2.7dist(zope.event) = 4.2 + python2dist(zope.event) = 4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope.interface) = 4.6 + python2dist(zope.interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.schema-4.4.2-py2.7.egg-info: + provides: |- + python2.7dist(zope.schema) = 4.4.2 + python2dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 3.6 + usr/lib/python3.10/site-packages/setuptools-41.6.0-py3.10.egg-info: + provides: |- + python3.10dist(setuptools) = 41.6 + python3dist(setuptools) = 41.6 + requires: |- + python(abi) = 3.10 + python3.10dist(setuptools) + usr/lib/python3.11/site-packages/pip-20.0.2-py3.11.egg-info: + provides: |- + python3.11dist(pip) = 20.0.2 + python3dist(pip) = 20.0.2 + requires: |- + python(abi) = 3.11 + python3.11dist(setuptools) + usr/lib/python3.9/site-packages/zope.component-4.3.0-py3.9.egg-info: + provides: |- + python3.9dist(zope.component) = 4.3 + python3dist(zope.component) = 4.3 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 4.1 + usr/lib/python3.9/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python3.9dist(zope.event) = 4.2 + python3dist(zope.event) = 4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.interface-5.1.0-py3.9.egg-info: + provides: |- + python3.9dist(zope.interface) = 5.1 + python3dist(zope.interface) = 5.1 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope.schema) = 4.4.2 + python3dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 3.6 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports.range) = 3.7.2 + python2dist(backports.range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: |- + python3.7dist(backports.range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.7 + --provides --majorver-provides --normalized-names-format legacy-dots --normalized-names-provide-both: + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope-component) = 4.3 + python2.7dist(zope.component) = 4.3 + python2dist(zope-component) = 4.3 + python2dist(zope.component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 4.1 + usr/lib/python2.7/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python2.7dist(zope-event) = 4.2 + python2.7dist(zope.event) = 4.2 + python2dist(zope-event) = 4.2 + python2dist(zope.event) = 4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope-interface) = 4.6 + python2.7dist(zope.interface) = 4.6 + python2dist(zope-interface) = 4.6 + python2dist(zope.interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.schema-4.4.2-py2.7.egg-info: + provides: |- + python2.7dist(zope-schema) = 4.4.2 + python2.7dist(zope.schema) = 4.4.2 + python2dist(zope-schema) = 4.4.2 + python2dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope.event) + python2.7dist(zope.interface) >= 3.6 + usr/lib/python3.9/site-packages/zope.component-4.3.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-component) = 4.3 + python3.9dist(zope.component) = 4.3 + python3dist(zope-component) = 4.3 + python3dist(zope.component) = 4.3 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 4.1 + usr/lib/python3.9/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python3.9dist(zope-event) = 4.2 + python3.9dist(zope.event) = 4.2 + python3dist(zope-event) = 4.2 + python3dist(zope.event) = 4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.interface-5.1.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-interface) = 5.1 + python3.9dist(zope.interface) = 5.1 + python3dist(zope-interface) = 5.1 + python3dist(zope.interface) = 5.1 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope-schema) = 4.4.2 + python3.9dist(zope.schema) = 4.4.2 + python3dist(zope-schema) = 4.4.2 + python3dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope.event) + python3.9dist(zope.interface) >= 3.6 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports-range) = 3.7.2 + python2.7dist(backports.range) = 3.7.2 + python2dist(backports-range) = 3.7.2 + python2dist(backports.range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: |- + python3.7dist(backports-range) = 3.7.2 + python3.7dist(backports.range) = 3.7.2 + python3dist(backports-range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.7 +--requires --normalized-names-format pep503: + --provides --majorver-provides --normalized-names-format pep503: + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope-component) = 4.3 + python2dist(zope-component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope-event) + python2.7dist(zope-interface) >= 4.1 + usr/lib/python2.7/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python2.7dist(zope-event) = 4.2 + python2dist(zope-event) = 4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope-interface) = 4.6 + python2dist(zope-interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.schema-4.4.2-py2.7.egg-info: + provides: |- + python2.7dist(zope-schema) = 4.4.2 + python2dist(zope-schema) = 4.4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope-event) + python2.7dist(zope-interface) >= 3.6 + usr/lib/python3.9/site-packages/zope.component-4.3.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-component) = 4.3 + python3dist(zope-component) = 4.3 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope-event) + python3.9dist(zope-interface) >= 4.1 + usr/lib/python3.9/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python3.9dist(zope-event) = 4.2 + python3dist(zope-event) = 4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.interface-5.1.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-interface) = 5.1 + python3dist(zope-interface) = 5.1 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope-schema) = 4.4.2 + python3dist(zope-schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope-event) + python3.9dist(zope-interface) >= 3.6 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports-range) = 3.7.2 + python2dist(backports-range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: |- + python3.7dist(backports-range) = 3.7.2 + python3dist(backports-range) = 3.7.2 + requires: python(abi) = 3.7 + --provides --majorver-provides --normalized-names-format pep503 --normalized-names-provide-both: + usr/lib/python2.7/site-packages/zope.component-4.3.0-py2.7.egg-info: + provides: |- + python2.7dist(zope-component) = 4.3 + python2.7dist(zope.component) = 4.3 + python2dist(zope-component) = 4.3 + python2dist(zope.component) = 4.3 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope-event) + python2.7dist(zope-interface) >= 4.1 + usr/lib/python2.7/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python2.7dist(zope-event) = 4.2 + python2.7dist(zope.event) = 4.2 + python2dist(zope-event) = 4.2 + python2dist(zope.event) = 4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.interface-4.6.0.dist-info: + provides: |- + python2.7dist(zope-interface) = 4.6 + python2.7dist(zope.interface) = 4.6 + python2dist(zope-interface) = 4.6 + python2dist(zope.interface) = 4.6 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + usr/lib/python2.7/site-packages/zope.schema-4.4.2-py2.7.egg-info: + provides: |- + python2.7dist(zope-schema) = 4.4.2 + python2.7dist(zope.schema) = 4.4.2 + python2dist(zope-schema) = 4.4.2 + python2dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 2.7 + python2.7dist(setuptools) + python2.7dist(zope-event) + python2.7dist(zope-interface) >= 3.6 + usr/lib/python3.9/site-packages/zope.component-4.3.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-component) = 4.3 + python3.9dist(zope.component) = 4.3 + python3dist(zope-component) = 4.3 + python3dist(zope.component) = 4.3 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope-event) + python3.9dist(zope-interface) >= 4.1 + usr/lib/python3.9/site-packages/zope.event-4.2.0.dist-info: + provides: |- + python3.9dist(zope-event) = 4.2 + python3.9dist(zope.event) = 4.2 + python3dist(zope-event) = 4.2 + python3dist(zope.event) = 4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.interface-5.1.0-py3.9.egg-info: + provides: |- + python3.9dist(zope-interface) = 5.1 + python3.9dist(zope.interface) = 5.1 + python3dist(zope-interface) = 5.1 + python3dist(zope.interface) = 5.1 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + usr/lib/python3.9/site-packages/zope.schema-4.4.2-py3.9.egg-info: + provides: |- + python3.9dist(zope-schema) = 4.4.2 + python3.9dist(zope.schema) = 4.4.2 + python3dist(zope-schema) = 4.4.2 + python3dist(zope.schema) = 4.4.2 + requires: |- + python(abi) = 3.9 + python3.9dist(setuptools) + python3.9dist(zope-event) + python3.9dist(zope-interface) >= 3.6 + usr/lib64/python2.7/site-packages/backports.range-3.7.2-py2.7.egg-info: + provides: |- + python2.7dist(backports-range) = 3.7.2 + python2.7dist(backports.range) = 3.7.2 + python2dist(backports-range) = 3.7.2 + python2dist(backports.range) = 3.7.2 + requires: python(abi) = 2.7 + usr/lib64/python3.7/site-packages/backports.range-3.7.2-py3.7.egg-info: + provides: |- + python3.7dist(backports-range) = 3.7.2 + python3.7dist(backports.range) = 3.7.2 + python3dist(backports-range) = 3.7.2 + python3dist(backports.range) = 3.7.2 + requires: python(abi) = 3.7 diff --git a/tests/data/scripts_pythondistdeps/test-requires.yaml b/tests/data/scripts_pythondistdeps/test-requires.yaml new file mode 100644 index 0000000000..c06d6c0375 --- /dev/null +++ b/tests/data/scripts_pythondistdeps/test-requires.yaml @@ -0,0 +1,97 @@ +setuptools: + wheel: + '41.6.0': ['2.7', '3.7', '3.9'] + sdist: + '41.6.0': ['2.7', '3.7', '3.9', '3.10'] +pip: + wheel: + '19.1.1': ['2.7', '3.7'] + '20.0.2': ['3.9'] + sdist: + '20.0.2': ['3.11'] +packaging: + wheel: + '19.0': ['2.7', '3.7'] + '20.1': ['3.9'] +attrs: + sdist: + '19.1.0': ['2.7', '3.9'] +pyparsing: + wheel: + '2.4.0': ['2.7', '3.7', '3.9'] +six: + wheel: + '1.12.0': ['2.7', '3.7', '3.9'] +tox: + wheel: + '3.14.0': ['2.7', '3.7', '3.9'] +urllib3: + sdist: + '1.25.7': ['2.7', '3.9'] +zope.component: + sdist: + '4.3.0': ['2.7', '3.9'] +zope.event: + wheel: + '4.2.0': ['2.7', '3.9'] +zope.schema: + sdist: + '4.4.2': ['2.7', '3.9'] +zope.interface: + sdist: + '5.1.0': ['3.9'] + wheel: + '4.6.0': ['2.7'] +lxml: + lib: lib64 + wheel: + '4.4.0': ['2.7', '3.7'] +scipy: + lib: lib64 + wheel: + '1.2.1': ['2.7', '3.7'] +numpy: + lib: lib64 + wheel: + '1.16.4': ['2.7'] + '1.17.4': ['3.7'] +numpy-stl: + lib: lib64 + sdist: + '2.11.2': ['2.7', '3.7', '3.9'] +PyQt5_sip: + lib: lib64 + wheel: + '4.19.19': ['3.7'] +PyQtWebEngine: + lib: lib64 + wheel: + '5.12.1': ['3.7', '3.9'] +MarkupSafe: + lib: lib64 + wheel: + '1.1.1': ['2.7', '3.7'] +simplejson: + lib: lib64 + sdist: + '3.16.0': ['2.7', '3.7', '3.9'] +backports.range: + lib: lib64 + sdist: + '3.7.2': ['2.7', '3.7', '3.9'] +mistune: + sdist: + '0.8.4': ['2.7', '3.9'] +astroid: + wheel: + '2.3.3': ['3.7', '3.9'] +kubernetes: + wheel: + '11.0.0b2': ['2.7'] + '11.0.0': ['3.9'] +fsleyes: + wheel: + '0.32.3': ['3.9'] +taskotron-python-versions: + wheel: + '0.1.dev6': ['3.9'] diff --git a/tests/test_scripts_pythondistdeps.py b/tests/test_scripts_pythondistdeps.py new file mode 100644 index 0000000000..5bbf357f18 --- /dev/null +++ b/tests/test_scripts_pythondistdeps.py @@ -0,0 +1,242 @@ +# Run tests using pytest, e.g. from the root directory +# $ python3 -m pytest --ignore tests/testing/ -vvv +# +# If there are any breakags, the best way to see differences is using a diff: +# $ diff tests/data/scripts_pythondistdeps/test-data.yaml <(python3 tests/test_scripts_pythondistdeps.py) +# +# - Test cases and expected results are saved in test-data.yaml inside +# TEST_DATA_PATH (currently ./data/scripts_pythondistdeps/) +# - To regenerate test-data.yaml file with the current results of +# pythondistdeps.py for each test configuration, execute this test file +# directly and results will be on stdout +# $ python3 test_scripts_pythondistdeps.py +# +# To add new test-data, add them to the test-requires.yaml: they will be +# downloaded automatically. And then add the resulting dist-info/egg-info paths +# into test-data.yaml under whichever requires/provides configurations you want +# to test +# - To find all dist-info/egg-info directories in the test-data directory, +# run inside test-data: +# $ find . -type d -regex ".*\(dist-info\|egg-info\)" | sort +# +# Requirements for this script: +# - Python >= 3.6 +# - pip >= 20.0.1 +# - setuptools +# - pytest +# - pyyaml +# - wheel + + +from pathlib import Path +import pytest +import shlex +import shutil +import subprocess +import sys +import tempfile +import yaml + +PYTHONDISTDEPS_PATH = Path(__file__).parent / '..' / 'scripts' / 'pythondistdeps.py' +TEST_DATA_PATH = Path(__file__).parent / 'data' / 'scripts_pythondistdeps' + + +def run_pythondistdeps(provides_params, requires_params, dist_egg_info_path): + """Runs pythondistdeps.py on `dits_egg_info_path` with given + provides and requires parameters and returns a dict with generated provides and requires""" + info_path = TEST_DATA_PATH / dist_egg_info_path + files = '\n'.join(map(str, info_path.iterdir())) + + provides = subprocess.check_output((sys.executable, PYTHONDISTDEPS_PATH, *shlex.split(provides_params)), + input=files, encoding="utf-8") + requires = subprocess.check_output((sys.executable, PYTHONDISTDEPS_PATH, *shlex.split(requires_params)), + input=files, encoding="utf-8") + + return {"provides": provides.strip(), "requires": requires.strip()} + + +def load_test_data(): + """Reads the test-data.yaml and loads the test data into a dict.""" + with TEST_DATA_PATH.joinpath('test-data.yaml').open() as file: + return yaml.safe_load(file) + + +def generate_test_cases(test_data): + """Goes through the test data dict and yields test cases. + Test case is a tuple of 4 elements: + - provides parameters + - requires parameters + - path to the dist-info/egg-info directory inside test-data + - dict with expected results ("requires" and "provides")""" + for requires_params in test_data: + for provides_params in test_data[requires_params]: + for dist_egg_info_path in test_data[requires_params][provides_params]: + expected = test_data[requires_params][provides_params][dist_egg_info_path] + yield (provides_params, requires_params, dist_egg_info_path, expected) + + +def check_and_install_test_data(): + """Checks if the appropriate metadata are present in TEST_DATA_PATH, and if + not, downloads them through pip from PyPI.""" + with TEST_DATA_PATH.joinpath('test-requires.yaml').open() as file: + test_requires = yaml.safe_load(file) + downloaded_anything = False + + for package in test_requires: + # To be as close to the real environment, we want some packages saved in /usr/lib64 instead of /usr/lib, + # for these we explicitly set lib64 as a parameter, and by default we use /usr/lib. + lib = test_requires[package].pop("lib", "lib") + + # type is either `wheel` or `sdist` + for type in test_requires[package]: + for pkg_version in test_requires[package][type]: + for py_version in test_requires[package][type][pkg_version]: + py_version_nodots = py_version.replace(".", "") + package_underscores = package.replace("-", "_") + + suffix = ".egg-info" if type == "sdist" else ".dist-info" + pre_suffix = f"-py{py_version}" if type == "sdist" else "" + + install_path = TEST_DATA_PATH / "usr" / lib / f"python{py_version}" \ + / "site-packages" / f"{package_underscores}-{pkg_version}{pre_suffix}{suffix}" + + if install_path.exists(): + continue + + # If this is the first package we're downloading, + # display what's happening + if not downloaded_anything: + print("=====================") + print("Downloading test data") + print("=====================\n") + downloaded_anything = True + + # We use a temporary directory to unpack/install the + # package to, and then we move only the metadata to the + # final location + with tempfile.TemporaryDirectory() as temp_dir: + import runpy + backup_argv = sys.argv[:] + + if type == "wheel": + from pkg_resources import parse_version + abi = f"cp{py_version_nodots}" + # The "m" was removed from the abi flag in Python version 3.8 + if parse_version(py_version) < parse_version('3.8'): + abi += "m" + + # Install = download and unpack wheel into our + # temporary directory + sys.argv[1:] = ["install", "--no-deps", + "--only-binary", ":all:", + "--platform", "manylinux1_x86_64", + "--python-version", py_version, + "--implementation", "cp", + "--abi", abi, + "--target", temp_dir, + "--no-build-isolation", + f"{package}=={pkg_version}"] + else: + # Download sdist that we'll unpack later + sys.argv[1:] = ["download", "--no-deps", + "--no-binary", ":all:", + "--dest", temp_dir, + "--no-build-isolation", + f"{package}=={pkg_version}"] + + try: + # run_module() alters sys.modules and sys.argv, but restores them at exit + runpy.run_module("pip", run_name="__main__", alter_sys=True) + except SystemExit as exc: + pass + finally: + sys.argv[:] = backup_argv + + temp_path = Path(temp_dir) + if type == "sdist": + # Wheel were already unpacked by pip, sdists we + # have to unpack ourselves + sdist_path = next(temp_path.glob(f"{package}-{pkg_version}.*")) + + if sdist_path.suffix == ".zip": + import zipfile + archive = zipfile.ZipFile(sdist_path) + else: + import tarfile + archive = tarfile.open(sdist_path) + + archive.extractall(temp_path) + try: + info_path = next(temp_path.glob(f"**/*{suffix}")) + + # Let's check the wheel metadata has the + # expected directory name. We don't check for + # egg-info metadata, because we're pulling them + # from sdists where they don't have the proper + # directory name + if type == "wheel": + if info_path.name != install_path.name: + print("\nWarning: wheel metadata have unexpected directory name.\n" + f"Expected: {install_path.name}\n" + f"Actual: {info_path.name}\n" + f"Info: package '{package}', version '{pkg_version}'" + f" for Python {py_version}\n" + f"Possible resolution: Specify the package version with" + f" trailing zeros in test-requires.yaml", file=sys.stderr) + + shutil.move(info_path, install_path) + + relative_path = install_path.relative_to(TEST_DATA_PATH) + print(f"\nDownloaded metadata to '{relative_path}'" \ + f" inside test-data directory.\n") + except StopIteration: + # temp_path.glob() did not find any file and + # thus there's been some problem + sys.exit(f"Problem occured while getting dist-info/egg-info" + f" for package '{package}', version '{pkg_version}'" + f" for Python {py_version}") + if downloaded_anything: + print("\n==============================") + print("Finished downloading test data") + print("==============================") + + +@pytest.fixture(scope="session", autouse=True) +def fixture_check_and_install_test_data(): + """Wrapper fixture, because a fixture can't be called as a function.""" + check_and_install_test_data() + + +@pytest.mark.parametrize("provides_params, requires_params, dist_egg_info_path, expected", + generate_test_cases(load_test_data())) +def test_pythondistdeps(provides_params, requires_params, dist_egg_info_path, expected): + """Runs pythondistdeps with the given parameters and dist-info/egg-info + path, compares the results with the expected results""" + assert expected == run_pythondistdeps(provides_params, requires_params, dist_egg_info_path) + + +if __name__ == "__main__": + """If the script is called directly, we check and install test data if needed, + we look up all the test configurations in test-data.yaml, run + pythondistdeps for each, save the results and print the resulting YAML file + with the updated results.""" + + check_and_install_test_data() + + # Set YAML dump style to block style + def str_presenter(dumper, data): + if len(data.splitlines()) > 1: # check for multiline string + return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='|') + return dumper.represent_scalar('tag:yaml.org,2002:str', data) + yaml.add_representer(str, str_presenter) + + # Run pythondistdeps for each test configuration + test_data = load_test_data() + for provides_params, requires_params, dist_egg_info_path, expected in generate_test_cases(test_data): + # Print a dot to stderr for each test run to keep user informed about progress + print(".", end="", flush=True, file=sys.stderr) + test_data[requires_params][provides_params][dist_egg_info_path] = \ + run_pythondistdeps(provides_params, requires_params, dist_egg_info_path) + + print(yaml.dump(test_data, indent=4)) +