Dne 17. 06. 21 v 10:06 Ben Greiner napsal(a):
But I'd like to avoid pytest. Is there an arch-specific macro for using unittest module? Yes, %pyunittest_arch, or if you don't have a recent python-rpm-macros:
%{python_expand # export PYTHONPATH=%{buildroot}%{$python_sitearch} $python -B -m unittest discover -v }
Two mistakes from my first reply: - %buildroot, not %builddir. - I forgot to mention the -B (or export PYTHONDONTWRITEBYTECODE=1). It should also be present in order to avoid unreproducible builds.
The difference between pure libs and packages with C extensions is %{$python_sitelib} (= /usr/lib/python3.X/site-packages) vs %{$python_sitearch} (= /usr/lib64/python3.X/site-packages). For everything else, see [1, 2].
I am not a d:l:p maintainer, but I am sure the manual expansion is acceptable. Nobody is forced to use the macros.
Could you please file a bug, that python-rpm-macros in SLE-15 is too old? Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mcepl@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 Somewhere at the edge of the Bell curve was the girl for me. -- Based on http://xkcd.com/314/