python-rpm-generators/tests/data/scripts_pythondistdeps/test-requires.yaml
Miro Hrončok 0bd051d514 Don't include all requirements with True-evaluating markers in extras subpackages
The idea is that the extra subpackage only has requirements specific to that extra.
The logic however only excluded requirements without markers,
but requirements with *a* marker that was correct leaked to all extras subpackages.

E.g. with the following requirements:

    Requires-Dist: base-dependency
    Requires-Dist: base-dependency-with-matching-marker ; python_version < "3.15"
    Requires-Dist: base-dependency-with-unmatching-marker ; python_version < "3.8"
    Provides-Extra: an-extra
    Requires-Dist: extra-only-dependency-with-matching-marker ; extra == 'an-extra' and python_version < "3.15"
    Requires-Dist: extra-only-dependency-with-unmatching-marker ; extra == 'an-extra' and python_version < "3.8"

On Python 3.10, the base package generated the following requirements:

    python3.10dist(base-dependency)
    python3.10dist(base-dependency-with-matching-marker)

And for the [an-extra] extra:

    python3.10dist(base-dependency-with-matching-marker)  <--- REDUNDANT, WRONG
    python3.10dist(extra-only-dependency-with-matching-marker)

Now we no longer just check if the marker evaluates to True,
but we also check that the same marker evaluates to False when the extra is not given.

A real package with this issue is build[virtualenv] 0.8.0, which we use for tests. The package has:

    Requires-Dist: tomli (>=1.0.0) ; python_version < "3.11"

And on Python 3.10, it generated the following dependency for python3-build+virtualenv-0.8.0-2.fc37.noarch.rpm:

    python3.10dist(tomli) >= 1

Now it no longer does. This is asserted in tests.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2090186

Upstream PR: https://github.com/rpm-software-management/python-rpm-packaging/pull/16
2022-06-02 12:05:11 +02:00

106 lines
1.9 KiB
YAML

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.8', '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']
dnspython:
sdist:
'2.1.0': ['3.9']
wheel:
'2.1.0': ['3.9']
build:
wheel:
'0.8.0': ['3.10']