Dependency generators for Python RPMs
Go to file
Miro Hrončok 20f8b2c775 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
2021-04-19 22:59:10 +02:00
tests Do not generate setuptools requirement for console_scripts on Python 3.10+ 2021-03-31 11:56:16 +02:00
.gitignore Add __pycache__ into .gitignore 2021-03-11 13:41:54 +01:00
COPYING Fork upstream generators 2018-02-11 00:50:54 +01:00
python-rpm-generators.spec Fix python(abi) generator (the one written in Python) 2021-04-19 22:59:10 +02:00
python.attr Fix python(abi) requires generator, it picked files from almost good directories 2020-06-18 13:32:24 +02:00
pythonbundles.py Add executable bit to pythonbundles.py 2020-10-19 12:56:51 +02:00
pythondist.attr Do not generate setuptools requirement for console_scripts on Python 3.10+ 2021-03-31 11:56:16 +02:00
pythondistdeps.py Fix python(abi) generator (the one written in Python) 2021-04-19 22:59:10 +02:00
pythonname.attr Deduplicate automatically provided names trough Python RPM Lua macros 2020-05-05 14:02:52 +02:00
sources pythondistdeps.py: Compare extras as lowercase 2021-03-11 13:41:25 +01:00
update-test-sources.sh pythondistdeps.py: Compare extras as lowercase 2021-03-11 13:41:25 +01:00