Commit Graph

7 Commits

Author SHA1 Message Date
Miro Hrončok
dd063ac154 Fix python(abi) generator (the one written in Python)
There were three problems:

 - sys.version was not imported
 - sys.version[:3] is not reliable on Python 3.10+
 - distutils is deprecated on Python 3.10+

We were not hit by the missing import in Fedora because we only run the script
on .dist-info/.egg-info/.egg and not on .py files, so this if-branch never runs.

But when the script was fed with a .py path, it errored:

    Traceback (most recent call last):
      File "/usr/lib/rpm/pythondistdeps.py", line 344, in <module>
        purelib = get_python_lib(standard_lib=0, plat_specific=0).split(version[:3])[0]
    NameError: name 'version' is not defined

The sys.version[:3] thing kinda works for Python 3.10+ because *in this
particular case* splitting on '3.1' and taking the prefix yields the same
results as splitting on '3.10', but I consider that mere coincidence.

Finally, since the distutils import happened at module-level,
we got the Deprecation warning in all Fedora's Python packages:

    /usr/lib/rpm/pythondistdeps.py:16: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12

Backported from https://github.com/rpm-software-management/python-rpm-packaging/commit/d12e039037

Related: rhbz#1950291
2021-04-22 18:36:59 +02:00
Miro Hrončok
e0cf6decc7 Do not generate setuptools requirement for console_scripts on Python 3.10+
See https://fedoraproject.org/wiki/Changes/Reduce_dependencies_on_python3-setuptools

Related: rhbz#1950291
Fixes: rhbz#1947075
2021-04-22 18:35:47 +02:00
DistroBaker
de0b994981 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/python-rpm-generators.git#a295a5855988a761a2adf2e87a06c01fbcc6439b
2021-03-15 19:03:18 +00:00
DistroBaker
f34fdc5636 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/python-rpm-generators.git#48510eebaebd2620d6b6a74f51e8478bbb2b7ad9
2021-03-11 20:32:25 +00:00
DistroBaker
79d9387a7b Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/python-rpm-generators.git#438d8d3b705e88b62d4d36347338fd5357a71687
2021-02-18 18:40:22 +00:00
DistroBaker
faf2d6b731 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/python-rpm-generators.git#f328c9dd189053d0ceea722e28176261cf64fd15
2020-11-03 20:53:42 +00:00
Troy Dawson
e25505c276 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-rpm-generators#bfb7f70b994d667b703a6b16c2b35d5056572800
2020-10-14 20:10:06 -07:00