#72 [epel8] Override %py3_check_import and %__pytest
Opened 11 months ago by gotmax23. Modified 11 months ago
rpms/ gotmax23/epel-rpm-macros check_import  into  epel8

file modified
+6 -1
@@ -1,6 +1,6 @@ 

  Name:           epel-rpm-macros

  Version:        8

- Release:        39

+ Release:        40

  Summary:        Extra Packages for Enterprise Linux RPM macros

  

  License:        GPLv2
@@ -126,6 +126,11 @@ 

  

  

  %changelog

+ * Wed Jun 07 2023 Maxwell G <maxwell@gtmx.me> - 8-40

+ - Move %%py3_check_import definition to macros.zzz-epel-override.

+ - Relates: #2207631

+ - Override %%__pytest to make it work with multi-python specfiles

+ 

  * Fri Apr 07 2023 Miro HronĨok <mhroncok@redhat.com> - 8-39

  - Prepare support for Python 3.11

  

file modified
+33
@@ -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}

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/8ff337e40da94e52a34029f8e18bd877

1 new commit added

  • Override %__pytest to work with multi-python specfiles
11 months ago

I changed the PR title to account for the new commit

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/d4e5f13e114144ba89c2baba38e047c0