Closed danigm closed 1 year ago
This prevents any PyPI package ending in -py%d+
https://pypi.org/search/?q=-py3
Granted these probably won't be packaged ever, but the next package necessary to be included might just be around the corner.
Why not just explicitly use %files -n python3-FOO
and the same for %package
and %description
?
Or why not directly use python3-FOO
as specfile name? I am not sure if the latter still works, but orginally the python_subpackages rewriter was written with the possibility in mind that a python3-FOO.rpm from a python3-FOO.spec would be included.
This prevents any PyPI package ending in -py%d+
The name collision is a big problem, so if we want to go ahead with this rename we should take a more rare suffix, not just -py3
.
Or why not directly use python3-FOO as specfile name? I am not sure if the latter still works, but orginally the python_subpackages rewriter was written with the possibility in mind that a python3-FOO.rpm from a python3-FOO.spec would be included.
That was the first idea, but it'll require more work because Requires
, Provides
and other python-foo
names used are not translated in subpackages if the package name is the same as the pythons
, so it cannot be just a package rename, it'll requires to review all references to python-
in the spec file, something that's done automatically by the python_subpackages
macro.
Replace all python-
with python3-
or whatever prefix you are using in the specfile name and it should translate all Requires
, Provides
etc. %python_subpackages
stays in effect. You can even have multiple flavors in both specs.
Maybe this is not a good idea at all, thinking about it and after @bnavigator comments and clarifications, I think that it's okay to just rename to python3-
and translate all Requires
, Provides
, etc.
This PR adds the name format
python-FOO-py3
as a valid package name to generateFOO
python package with the%{python_subpackages}
macro and includes a new macro%{name_without_py3_suffix}
to be able to use the generic package name in the spec file without the suffix.This is useful to have multiple packages in the same project that generates the same python subpackages, but for different python versions, without source package name collision and being able to keep almost the same
.spec
file. For example:pythons python3
, will generatepython3-FOO
binary.pythons python310 python311
will generatepython-310-FOO
andpython-311-FOO
binaries.