1
0

Accepting request 1146276 from home:bnavigator:branches:devel:languages:python:numeric

- Fix python312 tests: Force linking to openblas with custom
  pythranrc
- Remove test skips no longer needed
- Make test flavors future proof: Don't fail on empty buildset
- Skip python39 for all test flavors: The test-py39 multibuild has
  already been removed but it is still in the build set, so don't
  test it in the other multibuilds.
- Debundle xsimd

OBS-URL: https://build.opensuse.org/request/show/1146276
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=37
This commit is contained in:
Matej Cepl 2024-02-12 22:30:05 +00:00 committed by Git OBS Bridge
parent 3a1f027049
commit fabf7106e6
4 changed files with 47 additions and 30 deletions

View File

@ -1,5 +1,5 @@
<multibuild>
<package>test-py310</package>
<package>test-py311</package>
<!-- <package>test-py312</package> -->
<package>test-py312</package>
</multibuild>

View File

@ -1,3 +1,6 @@
# SECTION This is a package that compiles code, the runtime requires devel packages
addFilter('devel-file-in-non-devel-package .*/site-packages/pythran/.*')
addFilter('devel-dependency .*')
addFilter('python-leftover-require python.*-numpy-devel')
# these are "default" headers for packages
addFilter('hidden-file-or-dir .*/\.hpp')

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Wed Feb 7 13:53:21 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Fix python312 tests: Force linking to openblas with custom
pythranrc
- Remove test skips no longer needed
- Make test flavors future proof: Don't fail on empty buildset
- Skip python39 for all test flavors: The test-py39 multibuild has
already been removed but it is still in the build set, so don't
test it in the other multibuilds.
- Debundle xsimd
-------------------------------------------------------------------
Tue Feb 6 11:05:29 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -17,6 +17,8 @@
%global flavor @BUILD_FLAVOR@%{nil}
# global stop testing even when it is still in buildset (otherwise every test flavor would also test this one)
%define skip_python39 1
%if "%{flavor}" == "test-py310"
%define psuffix -test-py310
%define skip_python311 1
@ -37,10 +39,15 @@
%bcond_with test
%else
%bcond_without test
# do nothing in a test flavor that is still around but has nothing in buildset anymore
# (The obs server-side interpreter cannot use lua or rpm shrink)
%if "%{pythons}" == "" || "%{pythons}" == " " || "%{pythons}" == " " || "%{pythons}" == " " || "%{pythons}" == " "
ExclusiveArch: donotbuild
%define python_module() %flavor-not-enabled-in-buildset
%else
ExclusiveArch: x86_64
%endif
# ImportError: /home/abuild/rpmbuild/BUILD/pythran-0.15.0/test_np_dot9.cpython-312-x86_64-linux-gnu.so: undefined symbol: cblas_dgemv
%global skip_python312 1
%endif
%{?sle15_python_module_pythons}
Name: python-pythran%{psuffix}
Version: 0.15.0
@ -48,7 +55,7 @@ Release: 0
Summary: Ahead of Time compiler for numeric kernels
License: BSD-3-Clause
URL: https://github.com/serge-sans-paille/pythran
# Tests are only availble in github archive
# Tests are only availble from the github archive
Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz
Source99: python-pythran-rpmlintrc
BuildRequires: %{python_module pip}
@ -58,17 +65,17 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-beniget >= 0.4.0
Requires: python-gast >= 0.5.0
Requires: python-numpy
Requires: python-ply >= 3.4
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
# SECTION This is a package that compiles code, the runtime requires devel packages, inspired by fedora package
# SECTION This is a package that compiles code, the runtime requires devel packages
Requires: boost-devel
Requires: gcc-c++
Requires: openblas-devel
Requires: python-devel
Requires: python-numpy-devel
# Not available, use bundled
# Requires: xsimd-devel >= 8
Requires: xsimd-devel
# /SECTION
%if %{with test}
BuildRequires: %{python_module ipython}
@ -77,7 +84,7 @@ BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pythran = %{version}}
BuildRequires: %{python_module wheel}
BuildRequires: gcc-c++
BuildRequires: openblas-devel
BuildRequires: unzip
%endif
BuildArch: noarch
@ -96,25 +103,15 @@ sed -i '1{/env python/d}' pythran/run.py
find -type f -name "*.swp" -delete
# Remove bundled header libs and use the ones from system
rm -r pythran/boost
# Register pytest.mark.module
cat >> pytest.ini << EOF
# https://github.com/serge-sans-paille/pythran/pull/286
[pytest]
markers =
module: execute module annotate class
EOF
# The tests have some cflags in them
# We need to adapt the flags to play nicely with other obs flags
# E.g. fortify source implies at least -O1
sed -i -e 's/-O0/-O1/g' -e 's/-Werror/-w/g' pythran/tests/__init__.py
rm -r pythran/boost pythran/xsimd
%build
%pyproject_wheel
%if !%{with test}
%pyproject_wheel
%endif
%install
%if !%{with test}
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pythran
%python_clone -a %{buildroot}%{_bindir}/pythran-config
@ -124,11 +121,16 @@ sed -i -e 's/-O0/-O1/g' -e 's/-Werror/-w/g' pythran/tests/__init__.py
%if %{with test}
%check
export CFLAGS="%{optflags}"
# crashes the xdist workers
donttest="test_operator_intersection"
# gh#serge-sans-paille/pythran#2044 NOT FIXED by gh#serge-sans-paille/pythran#2046
donttest="$donttest or test_toolchain or test_cli"
%pytest %{?jobs:-n %jobs} -k "not ($donttest)" -m "not module"
# Force to link against openblas during tests because the update-alternatives setup
# for lapack/cblas/openblas might be inconsistent inside obs builds
cat > config.pythranrc <<EOF
[compiler]
blas=openblas
libs=openblas
EOF
export PYTHRANRC=$PWD/config.pythranrc
# pytest_extra_args is for debug builds with local defines on command line
%pytest %{?jobs:-n %jobs} %{?pytest_extra_args}
%endif
%if !%{with test}