Bug 1931421
Summary: | Python dist RPM generators crash with Python 3.10, deps not generated, rpmbuild proceeds | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
Component: | python-rpm-generators | Assignee: | Tomas Orsava <torsava> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | cstratak, lbalhar, m.cyprian, mhroncok, ngompa13, pviktori, shcherbina.iryna, thrnciar, torsava |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-rpm-generators-12-3.fc34 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-03-19 17:37:20 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1890881 |
Description
Miro Hrončok
2021-02-22 11:40:16 UTC
This is a change in Python 3.10: $ python3.9 Python 3.9.2 (default, Feb 20 2021, 00:00:00) ... >>> from pathlib import Path >>> from importlib.metadata import PathDistribution >>> class Distribution(PathDistribution): ... def __init__(self, path): ... super(Distribution, self).__init__(Path(path)) ... self.name = self.metadata['Name'] ... >>> Distribution('a') <__main__.Distribution object at 0x7f6c33e29a60> $ python3.10 Python 3.10.0a5 (default, Feb 3 2021, 14:01:21) ... >>> from pathlib import Path >>> from importlib.metadata import PathDistribution >>> class Distribution(PathDistribution): ... def __init__(self, path): ... super(Distribution, self).__init__(Path(path)) ... self.name = self.metadata['Name'] ... >>> Distribution('a') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 4, in __init__ AttributeError: can't set attribute 'name' https://src.fedoraproject.org/rpms/python-rpm-generators/blob/rawhide/f/pythondistdeps.py#_56 A solution might be to use a wrapper class instead of inheritance. https://src.fedoraproject.org/rpms/python-rpm-generators/pull-request/34 is used in Python 3.10 copr, hence no longer urgent. We have found one more problem with the new generators. python3-pip provides: … some bundled stuff … pip = 21.0.1-1.fc35 python-pip = 21.0.1-1.fc35 python3-pip = 21.0.1-1.fc35 python3.10dist(pip) = 21.0.1 python3.9-pip = 21.0.1-1.fc35 Which is wrong. There is no python3dist(pip) which is required by all projects using pyproject-rpm-macros, and there is python3.9-pip for some unknown reason. I'm talking about this build: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/2014234/ > there is python3.9-pip for some unknown reason. https://src.fedoraproject.org/rpms/python-rpm-generators/blob/rawhide/f/pythonname.attr Both the generators use the value of %__default_python3_version to determine, well, the default Python 3 version. When the macro is set to 3.9, python3-foo provides python3.9-foo and Python 3.10 packages *don't* provide python3dist(foo). When the macro is set to 3.10, python3-foo provides python3.10-foo and Python 3.10 packages provide python3dist(foo). The macro is set in the python-srpm-macros package, in the /usr/lib/rpm/macros.d/macros.python-srpm file. In Python 3.10 copr, the package is set to build from this PR: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/84 Yet it seems the latest build in copr was not done from that PR, but from a SRPM instead. The SRPM has version 3.10, but sets %__default_python3_version to 3.9. Hence, the generators do what they are supposed to do. > Yet it seems the latest build in copr was not done from that PR, but from a SRPM instead. The SRPM has version 3.10, but sets %__default_python3_version to 3.9. https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/2013583/ (In reply to Lumír Balhar from comment #4) > We have found one more problem with the new generators. python3-pip provides: > > … some bundled stuff … > pip = 21.0.1-1.fc35 > python-pip = 21.0.1-1.fc35 > python3-pip = 21.0.1-1.fc35 > python3.10dist(pip) = 21.0.1 > python3.9-pip = 21.0.1-1.fc35 > > Which is wrong. There is no python3dist(pip) which is required by all > projects using pyproject-rpm-macros, and there is python3.9-pip for some > unknown reason. This was fixed. > The SRPM has version 3.10, but sets %__default_python3_version to 3.9. Prevention: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/91 FEDORA-2021-1bbdfbcc31 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-1bbdfbcc31 FEDORA-2021-1bbdfbcc31 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2021-1bbdfbcc31 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report. |