openSUSE / python-rpm-macros

Multi-Python, Single-Spec macros generator
Other
22 stars 20 forks source link

%python_module problems when flavors python2 and python3 are disabled #33

Closed jayvdb closed 3 years ago

jayvdb commented 5 years ago

I have a hacky project conf which eliminates py2 from the project https://build.opensuse.org/project/prjconf/home:jayvdb:py3only

The most obvious ugly side effect is py2-only packages become "unresolvable" (great!), but the reason is "nothing provides STOP-setuptools, nothing provides MACRO" e.g. https://build.opensuse.org/project/monitor/home:jayvdb:py3only?arch_x86_64=1&defaults=0&repo_openSUSE_Tumbleweed=1&unresolvable=1 currently bz2file, ipykernel & ipython

I guess the nothing provides STOP-setuptools is caused by https://github.com/openSUSE/python-rpm-macros/blob/d9968ab7b3c753a3cc82ec0b1d8fab1a249a09c1/buildset.in

%python_module_iter(a:) %{-a*}-%{args} %{expand:%%{?!python_module_iter_%1:%%{python_module_iter -a %*}}}
%python_module_iter_STOP stop
%python_module() %{expand:%%define args %{**}} %{expand:%%{python_module_iter -a %{pythons} STOP}}

If there isnt an easy way around that, I guess it could be made a bit prettier by replacing STOP with py0

"nothing provides MACRO" may be the same cause; i'm not sure.

jayvdb commented 5 years ago

The python-backports.* series have even stranger errors

[   39s] python_module_iter: option requires an argument -- 'a'
[   39s] error: Unknown option a in python_module_iter(a:)
[   39s] error: line 31: BuildRequires:  %{python_module setuptools}

https://build.opensuse.org/package/live_build_log/home:jayvdb:py3only/python-backports.functools_partialmethod/openSUSE_Tumbleweed/x86_64 Probably related to their .spec containing syntax like

%if %{python3_version_nodots} > 35
%define skip_python3 1
%endif
scarabeusiv commented 5 years ago

This is a result of the packages not having any flavor at all, so they get unresolvable, we didn't solve this out as those packages will mostly need to be just deleted anyway because they serve no purpose on the product as they are having all the targets disabled. The message can be improved but as we plan to just kill them all in one batch it is kinda pointless to tweak the message.

mcepl commented 3 years ago

This issue is probably complete obsolete with new versions of this package, isn't it?

mcepl commented 3 years ago

No response, closing this. Please, feel free to reopen with the additional information.