It seems that the importlib.metadata change introduced a regression wrt case sensitivity in extras names: python-dns has: %{?python_extras_subpkg:%python_extras_subpkg -n python3-dns -i %{python3_sitelib}/*.egg-info dnssec trio doh idna} And the actual build with generators version 11 had: Provides: python-dns+dnssec = 2.1.0-2.fc34 python3-dns+dnssec = 2.1.0-2.fc34 python3.9-dns+dnssec = 2.1.0-2.fc34 python3.9dist(dnspython[dnssec]) = 2.1 python3dist(dnspython[dnssec]) = 2.1 ... While currently, it fails with: Error: The package name contains an extras name `dnssec` that was not found in the metadata. See https://koschei.fedoraproject.org/package/python-dns?collection=f35 I've checked the metadata and it contains: [DNSSEC] cryptography>=2.6 So this is a case sensitivity issue. I am completely fine if we have to change the definition to use DNSSEC over dnssec, but currently the package name and provide is upper case: Provides: python-dns+DNSSEC = 2.1.0-3.fc35 python3-dns+DNSSEC = 2.1.0-3.fc35 python3.9-dns+DNSSEC = 2.1.0-3.fc35 python3.9dist(dnspython[DNSSEC]) = 2.1 python3dist(dnspython[DNSSEC]) = 2.1 That means: - nothing obsoletes the old python-dns+dnssec package - the %py3_dist macro cannot be used: %{py3_dist dnspython[DNSSEC]} -> python3dist(dnspython[dnssec]) I think we need to canonize the extras name before we put it in the provide (in Python) and we need to canonize it before we construct the package name (in Lua, but we have a macro).
See also https://github.com/pypa/setuptools/issues/1608
Good news: pip seem to treat dnspython[DNSSEC] and dnspython[dnssec] equally. bad news: it does not treat webscrapbook[adhoc-ssl] same as webscrapbook[adhoc_ssl], so we cannot use the same canonization rules as we do for names. I suspect we need to just lowercase it all, but we also need to to fix %py3_dist :( Either way, we should rally check what rules are there and if none, define them upstream.
Action plan: Quick fix (we assume extras name are exchangeable only if lower(extra_name1) == lower(extra_name2)): - Whatever case the packager uses in %python_extras_subpkg, it will end up in the RPM package name +suffix. For backwards compatibility, we don't change the case of the RPM package name in either way. - The generator reads the extra name from the RPM package name +suffix, as it was put by the packager, but it must successfully find the extra even if the case differs. - The generated provides must always provide the extras name in lowercase (regardless of the cases used in the RPM package name +suffix or the extras definition). Other replacements (e.g. of dashes, underscores, dots...) must not happen. - All generated requires on extras must always be generated in lowercase as well to match the above. Other replacements (e.g. of dashes, underscores, dots...) must not happen. Later: - The %py3_dist macro must only lowercase the part in [], it should not try to canonize it as it currently does. - We should figure out what is the correct canonical form of an extra name and make sure we obey the rules. - We should document this in the guidelines.
- Ensure that %pyproject_buildrequires generates BuildRequires on extras in lower case. Other replacements in extras names (e.g. of dashes, underscores, dots...) must not happen.
In the meantime, I've started an upstream discussion about this problem: https://discuss.python.org/t/what-extras-names-are-treated-as-equal-and-why/7614
PR: https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/35
FEDORA-2021-2712494d03 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-2712494d03
FEDORA-2021-2712494d03 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-2712494d03` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-2712494d03 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-2712494d03 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
Finally, an upstream PR: https://github.com/pypa/packaging/pull/545