# # spec file for package python-pythran # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor %{nil} %{?sle15_python_module_pythons} %if "%{flavor}" == "" %define psuffix %{nil} %bcond_with test %else %define psuffix -%{flavor} %bcond_without test %if "%{flavor}" != "test-py310" %define skip_python310 1 %endif %if "%{flavor}" != "test-py311" %define skip_python311 1 %endif %if "%{flavor}" != "test-py312" %define skip_python312 1 %endif %if "%{flavor}" != "test-py313" %define skip_python313 1 %endif # Skip empty buildsets, last one is for sle15_python_module_pythons %if "%{shrink:%{pythons}}" == "" || ("%pythons" == "python311" && 0%{?skip_python311}) ExclusiveArch: donotbuild %define python_module() %flavor-not-enabled-in-buildset-for-suse-%{?suse_version} %else ExclusiveArch: x86_64 %endif %endif Name: python-pythran%{psuffix} Version: 0.17.0 Release: 1.4 Summary: Ahead of Time compiler for numeric kernels License: BSD-3-Clause URL: https://github.com/serge-sans-paille/pythran # 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} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-beniget >= 0.4.0 Requires: python-numpy Requires: python-ply >= 3.4 Requires: python-setuptools Requires: (python-gast >= 0.6.0 with python-gast < 0.7.0) Requires(post): update-alternatives Requires(postun): update-alternatives # SECTION This is a package that compiles code, the runtime requires devel packages Requires: boost-devel Requires: gcc-c++ Requires: python-devel Requires: python-numpy-devel Requires: xsimd-devel >= 13.0.0 # /SECTION %if %{with test} BuildRequires: %{python_module ipython} BuildRequires: %{python_module packaging} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: %{python_module pythran = %{version}} BuildRequires: %{python_module wheel} %if 0%{?suse_version} > 1500 BuildRequires: openblas-devel %else BuildRequires: cblas-devel BuildRequires: lapack-devel %endif BuildRequires: unzip %endif BuildArch: noarch %python_subpackages %description Ahead of Time compiler for numeric kernels %prep %autosetup -p1 -n pythran-%{version} find -name '*.hpp' -exec chmod -x {} + sed -i '1{/env python/d}' pythran/run.py # remove embedded VIM swap files find -type f -name "*.swp" -delete # Remove bundled header libs and use the ones from system rm -r pythran/boost pythran/xsimd %build %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 %python_expand %fdupes %{buildroot}%{$python_sitelib} %endif %if %{with test} %check export CFLAGS="%{optflags}" %if 0%{?suse_version} > 1500 # 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 < - Update to 0.17.0 * Support parsing annotated statement * Document and test Meson integration * Update / improve Blas detection, including scipy-openblas * Fix usage of Blas library * Improve error reporting * Support array module * Reduce dependency on setuptools * Faster forward substitution * Enforce default optimization level to `-O2` - Drop upstreamed numpy-2.1-interval.patch - Drop upstreamed numpy-2.1-support.patch - Drop upstreamed support-gast-0.6.patch * Sun Sep 1 2024 Dirk Müller - Add patch numpy-2.1-support.patch, numpy-2.1-interval.patch: * Fix test suite failure with numpy 2.1 - prepare for python 3.13 * Wed Jul 31 2024 Steve Kowalik - Add patch support-gast-0.6.patch: * Support gast 0.6.0 changes, change Requires appropriately. * Sun Jun 30 2024 Dirk Müller - limit to gast < 0.6.0 * Thu Jun 6 2024 Dirk Müller - update to 0.16.1: * Fix massive memory leakage in all ndarray * Sat May 25 2024 Ben Greiner - Update to 0.16.0 * Support numpy.vectorize, numpy.argsort's kind keyword, real/imag on numpy_iexpr * Add missing omp.set_num_thread descriptor * Provide --trace-allocations switch * Support empty PYTHRANRC for reproducible builds * Improve compilation time * Support ufunc creation through #pythran export ufunc func_name(arg_types...) * Fix memory leak when returing numpy_gexpr to Python * Numpy 2.x support * Upgrade xsimd to 13.0.0 * Improve detection of non-overlapping memory area during gexpr assignment * Improve python 3.12 support (distutils removal) * Support imatmul * Only link blas when needed * Thu Apr 25 2024 Ben Greiner - Refactor the multibuild test flavor logic - Accomodate some 15.x intricacies for the failing tests: * use netlib lapack/blas instead of openblas * Fri Feb 23 2024 Dominique Leuenberger - Use newly supported shrink{} on OBS to exclude python flavors will all python versions skipped. * Sat Feb 17 2024 Ben Greiner - Yet another fix of the python39 test skip * Wed Feb 7 2024 Ben Greiner - 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 2024 Dirk Müller - update to 0.15.0: * Use pyproject.toml to store setup and build configuration * Upgrade xsimd to a48ab430d4b84ecd5449180ee1c6d2eed67c4191 * Improve detection of non-overlapping memory area during gexpr assignment * Support python 3.12 * Support list.clear * Improve detection of methods uses as functions * Tue Feb 6 2024 Dirk Müller - drop python39 from testing, add python312 * Wed Nov 29 2023 Steve Kowalik - Prepare for Python 3.12, by skipping it for the other test flavors, and adding one for it. * Tue Nov 21 2023 Steve Kowalik - Update to 0.14.0: * Numpy compatibility - update signatures, complex number handling, long double support * Lazyly import top-level modules and submodules * Improve array indexing by an array * Require at least clang 7 or gcc 8 * Make pythran compilation reproducible * Support np.roll with multiple axis * Support numpy.ndarray.view * Improve list resizing speed * Fix bug when filtering an empty sequence - Drop patches, now included upstream: * numpy-longdouble.patch * numpy-complex.patch - Switch to pyproject macros. * Tue Aug 8 2023 ecsos - Fix build error in Leap, because it must not be two "Patch:" lines. * Thu Jul 27 2023 Markéta Machová - Add upstream numpy-longdouble.patch and numpy-complex.patch to support new numpy * Sat Jun 10 2023 ecsos - Add %%{?sle15_python_module_pythons} * Mon May 15 2023 Dirk Müller - update to 0.13.1: * Bump xsimd dependency to 11.0.0, with a backported patch. * Improve performance of functions revieving scalar arguments. This changes the internal function call API. * Improve performance of fix-stride slicing, using a new slice representation. * Improve numpy.copyto performance, and detect copyto pattern usage. * Force internal linkage of generated functions, which gives more optimization room to the C++ compiler. * Provide entry points pythran.import_pythrancode and pythran.import_pythranfile, as a poor man JIT option. * Optimize numpy.argmax(cst * val) into numpy.argmax(val) when cst is positive. * Avoid copies upon numpy.array_split * Get rid of unused functions C++ warnings * Avoid generating a loop footer when the loop index is not used outside of the loop. - fix the test-flavor splitting for python311 * Wed Jan 25 2023 Dirk Müller - update to 0.12.1: * Bump xsimd depdency to 10.0.0 * Correctly raise KeyError when getting an unset dict item * Fix negative binomial implementation * Correctly convert strided array with offset * Support np.clip(v, None, x) and np.clip(v, x, None) * Support scipy.special.ndtr, scipy.special.ndtri, scipy.special.gammaincinv * Fix set intersection * Support numpy.fft.fftn * Support axis parameter in numpy.argsort * Sun Dec 25 2022 Ben Greiner - Revert. 2046-fix-cli-doc-test.patch did not fix the tests. gh#serge-sans-paille/pythran#2046 * Sat Dec 17 2022 Matej Cepl - Add 2046-fix-cli-doc-test.patch to fix failing tests (gh#serge-sans-paille/pythran#2046). * Fri Nov 25 2022 Matej Cepl - Skip also failing test_toolchain and test_cli (gh#serge-sans-paille/pythran#2044) tests. * Tue Oct 11 2022 Ben Greiner - Update to 0.12.0 * Improve numpy expression computation speed * Decent ICC support (fixing an issue from 2018!) * Much faster C++ code generation * Complete rework of constant folder * Support C++-time evaluation of numpy.ndarray.ndim * Improved omp declare reduction support * Allow indexing of ndarray by integers of mixed types * A lot of small pesty bug fixes in the C++ headers - Drop patches * gcc12-fixes.patch * pythran-pr1984-fixdistutils.patch * Mon Jul 18 2022 Ben Greiner - Add pythran-pr1984-fixdistutils.patch * gh#serge-sans-paille/pythran#1984 * Fixes gh#serge-sans-paille/pythran#1984 with setuptools >= 60 * Tue Mar 15 2022 Martin Liška - Add gcc12-fixes.patch in order to fix GCC 12 building issues. * Fri Jan 28 2022 Ben Greiner - Fix errors uncovered by staging: * Mention python-pythran-rpmlintrc * also make :test-py* noarch so that no debuginfo package fails * Sun Jan 23 2022 Ben Greiner - Initial specfile for 0.11 * debundling inspired by Fedora package: https://src.fedoraproject.org/rpms/pythran/blob/rawhide/f/pythran.spec - Required by scipy 1.7