From de3ed981e50ce52e6f01b15da2687f1015ead64d820ec85ec75ec00e195930bd Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 25 Jan 2022 07:19:24 +0000 Subject: [PATCH] Accepting request 948422 from home:bnavigator:branches:devel:languages:python:numeric now a mandatory build requirement of scipy 1.7 OBS-URL: https://build.opensuse.org/request/show/948422 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=1 --- .gitattributes | 23 +++++++ .gitignore | 1 + _multibuild | 5 ++ python-pythran-rpmlintrc | 3 + python-pythran.changes | 7 ++ python-pythran.spec | 142 +++++++++++++++++++++++++++++++++++++++ pythran-0.11.0-gh.tar.gz | 3 + 7 files changed, 184 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 python-pythran-rpmlintrc create mode 100644 python-pythran.changes create mode 100644 python-pythran.spec create mode 100644 pythran-0.11.0-gh.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..73ab5e8 --- /dev/null +++ b/_multibuild @@ -0,0 +1,5 @@ + + test-py38 + test-py39 + test-py310 + diff --git a/python-pythran-rpmlintrc b/python-pythran-rpmlintrc new file mode 100644 index 0000000..facea6d --- /dev/null +++ b/python-pythran-rpmlintrc @@ -0,0 +1,3 @@ +# 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 .*') \ No newline at end of file diff --git a/python-pythran.changes b/python-pythran.changes new file mode 100644 index 0000000..73707f9 --- /dev/null +++ b/python-pythran.changes @@ -0,0 +1,7 @@ +------------------------------------------------------------------- +Sun Jan 23 15:10:57 UTC 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 \ No newline at end of file diff --git a/python-pythran.spec b/python-pythran.spec new file mode 100644 index 0000000..b508759 --- /dev/null +++ b/python-pythran.spec @@ -0,0 +1,142 @@ +# +# spec file for package python-pythran +# +# Copyright (c) 2022 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} +%if "%{flavor}" == "test-py38" +%define psuffix -test-py38 +%define skip_python39 1 +%define skip_python310 1 +%bcond_without test +ExclusiveArch: x86_64 +%endif +%if "%{flavor}" == "test-py39" +%define psuffix -test-py39 +%define skip_python38 1 +%define skip_python310 1 +%bcond_without test +ExclusiveArch: x86_64 +%endif +%if "%{flavor}" == "test-py310" +%define psuffix -test-py310 +%define skip_python38 1 +%define skip_python39 1 +%bcond_without test +ExclusiveArch: x86_64 +%endif +%if "%{flavor}" == "" +%define psuffix %{nil} +%bcond_with test +BuildArch: noarch +%endif +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 +Name: python-pythran%{psuffix} +Version: 0.11.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 in github archive +Source: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-beniget >= 0.4.0 +Requires: python-gast >= 0.5.0 +Requires: python-ply >= 3.4 +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 +Requires: boost-devel +Requires: gcc-c++ +Requires: openblas-devel +Requires: python-devel +Requires: python-numpy-devel +# Not available, use bundled +# Requires: xsimd-devel >= 8 +# /SECTION +%if %{with test} +BuildRequires: %{python_module ipython} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module pythran = %{version}} +BuildRequires: %{python_module wheel} +BuildRequires: unzip +BuildRequires: gcc-c++ +%endif +%python_subpackages + +%description +Ahead of Time compiler for numeric kernels + +%prep +%setup -q -n pythran-%{version} + +find -name '*.hpp' -exec chmod -x {} + +sed -i '1{/env python/d}' pythran/run.py +sed -i "s/'python'/sys.executable/" pythran/tests/test_distutils.py + +# Remove bundled header libs and use the ones from system +rm -r third_party/boost +cat >> setup.cfg << EOF +[build_py] +no_boost=True +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 + +%build +%python_build + +%if !%{with test} +%install +%python_install +%python_clone -a %{buildroot}%{_bindir}/pythran +%python_clone -a %{buildroot}%{_bindir}/pythran-config +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%check +%if %{with test} +export CFLAGS="%{optflags}" +# crashes the xdist workers +donttest="test_operator_intersection" +%pytest -n auto -k "not ($donttest)" -m "not module" +%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}*-info +%endif + +%changelog diff --git a/pythran-0.11.0-gh.tar.gz b/pythran-0.11.0-gh.tar.gz new file mode 100644 index 0000000..fc82acb --- /dev/null +++ b/pythran-0.11.0-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e095a1e984f8f44cfdccb8dd797aec4f38d98a9026611235f55e6d5d3c300f08 +size 3582011