| |
@@ -25,3 +25,36 @@
|
| |
end
|
| |
print(bin)
|
| |
}
|
| |
+
|
| |
+ # Only python3.11-rpm-macros in RHEL 8 has %%py3_check_import defined,
|
| |
+ # but the definition is broken (https://bugzilla.redhat.com/2207631).
|
| |
+ # Once this issue is resolved, we can move this definition back to macros.epel
|
| |
+ # so the python3.11-rpm-macros version overrides this definition but it remains
|
| |
+ # available for older Python versions.
|
| |
+
|
| |
+ %py3_check_import(e:tf:) %{expand:\\\
|
| |
+ %{-e:echo 'WARNING: The -e option of %%%%py3_check_import is not currently supported on EPEL.' >&2}
|
| |
+ %{-t:echo 'WARNING: The -t option of %%%%py3_check_import is not currently supported on EPEL.' >&2}
|
| |
+ %{-f:echo 'WARNING: The -f option of %%%%py3_check_import is not currently supported on EPEL.' >&2}
|
| |
+ (cd %{_topdir} &&\\\
|
| |
+ PATH="%{buildroot}%{_bindir}:$PATH"\\\
|
| |
+ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
|
| |
+ PYTHONDONTWRITEBYTECODE=1\\\
|
| |
+ %{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
|
| |
+ )
|
| |
+ }
|
| |
+
|
| |
+ # This is needed for multi-python specfiles that switch around
|
| |
+ # %%python3_pkgversion.
|
| |
+ #
|
| |
+ # python3-rpm-macros sets %%__pytest to the same value as below as of
|
| |
+ # https://bugzilla.redhat.com/2091462 and
|
| |
+ # https://git.centos.org/rpms/python-rpm-macros/c/90be9a52cea954960e49dcd8cc87f9f330ff9f53?branch=c8s
|
| |
+ #
|
| |
+ # python39-rpm-macros overrides %%__pytest to /usr/bin/pytest-3.9 which doesn't
|
| |
+ # honor the value of python3_pkgversion.
|
| |
+ #
|
| |
+ # In order to make this work no matter what python3X-rpm-macros packages are
|
| |
+ # installed, we override %%__pytest here.
|
| |
+
|
| |
+ %__pytest /usr/bin/pytest-%{_python3_pkgversion_with_dot}
|
| |
Relates: https://bugzilla.redhat.com/2207631
/cc @churchyard