Files
python-pythran/python-pythran.spec
Benjamin Greiner 49a3c6413d Accepting request 1281224 from home:bnavigator:branches:devel:languages:python:numeric
- Update to 0.18.0 - balafenn
  * no upstream changelog.
  ## git commits (a few non-relevant filtered)
  * Fix uninitialized iexpr assignment
  * Fix folding of comparison operators
  * Take augassign into account when removing nested functions
  * Fix local processing in presence of else: clause in for loop
  * Fix detection of c++ compiler
  * Traverse augassign when computing scopes
  * Reproducible ContainerOf iteration
  * Fix overload handling for NoneType
  * Fix type inference in presence of augassign
  * Improve forward substitution in presence of augassign
  * Remove dead code in tests
  * Faster (and common!) implementation of make_integer_sequence
  * Only register a node in name_to_nodes if the combiner was
    succesful
  * Reproducible aliasing ordering
  * Reproducible nested functions removal
  * Reproducible topological order
  * Verify reproducibility of c++ output
  * Reproducible (because sortable) alias order
  * Stateless PType
  * Reproducible local declaration order
  * Reproducible identifiers generation
  * Reproducible include order
  * More flexible implementation of default list
  * Fix typing issue under complex slice combination
  * Add support for nonlocal keyword
  * Fix bug in nested function remover

OBS-URL: https://build.opensuse.org/request/show/1281224
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=56
2025-05-30 10:58:41 +00:00

158 lines
4.6 KiB
RPMSpec

#
# spec file for package python-pythran
#
# Copyright (c) 2025 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 @BUILD_FLAVOR@%{nil}
%{?sle15_python_module_pythons}
%if "%{flavor}" == ""
%define psuffix %{nil}
%bcond_with test
%else
%define psuffix -%{flavor}
%bcond_without test
%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.18.0
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 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 <<EOF
[compiler]
blas=openblas
libs=openblas
EOF
export PYTHRANRC=$PWD/config.pythranrc
%endif
# gh#serge-sans-paille/pythran#2317 -- changed AST in Py3.13
python313_skip_tests=("-k" "not test_tutorial")
# pytest_extra_args is for debug builds with local defines on command line
%pytest %{?jobs:-n %jobs} %{?pytest_extra_args} "${$python_skip_tests[@]}"
%endif
%if !%{with test}
%post
%python_install_alternative pythran pythran-config
%postun
%python_uninstall_alternative pythran
%files %{python_files}
%doc AUTHORS Changelog README.rst
%license LICENSE
%python_alternative %{_bindir}/pythran
%python_alternative %{_bindir}/pythran-config
%{python_sitelib}/pythran
%{python_sitelib}/omp
%{python_sitelib}/pythran-%{version}.dist-info
%endif
%changelog