8
0

- Run unit tests for all available python versions

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/xtensor-python?expand=0&rev=5
This commit is contained in:
2024-12-30 14:15:15 +00:00
committed by Git OBS Bridge
commit 55ef08022c
7 changed files with 209 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,30 @@
From 627ff935c580e5d43824b5ec884502e8b9811394 Mon Sep 17 00:00:00 2001
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Date: Mon, 6 May 2024 20:57:19 +0300
Subject: [PATCH] Install as arch-independent
xternsor-python is header only library, so prefer arch-independed paths cmake.
References:
* https://github.com/xtensor-stack/xtl/commit/d877d94836aff4d0f727acf3eaab8f4880ecb625
* https://github.com/xtensor-stack/xtensor/commit/7738389861044c9618c7d59fb7602f7dddc1df7f
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6521c98..47af271 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,7 +123,7 @@ export(EXPORT ${PROJECT_NAME}-targets
install(FILES ${XTENSOR_PYTHON_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtensor-python)
-set(XTENSOR_PYTHON_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE
+set(XTENSOR_PYTHON_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE
STRING "install path for xtensor-pythonConfig.cmake")
configure_package_config_file(${PROJECT_NAME}Config.cmake.in
--
2.44.0

13
cxx-flags.patch Normal file
View File

@@ -0,0 +1,13 @@
Index: xtensor-python-0.27.0/test/CMakeLists.txt
===================================================================
--- xtensor-python-0.27.0.orig/test/CMakeLists.txt
+++ xtensor-python-0.27.0/test/CMakeLists.txt
@@ -30,7 +30,7 @@ include(CheckCXXCompilerFlag)
string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wunused-parameter -Wextra -Wreorder -Wconversion -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder -Wconversion -fvisibility=hidden")
CHECK_CXX_COMPILER_FLAG("-std=c++14" HAS_CPP14_FLAG)
if (HAS_CPP14_FLAG)

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:40ee01bd213aeb7bf64f6d8a3257f4fa98ed31c401596c6c7b3b115f61a473b9
size 65455

14
xtensor-python.changes Normal file
View File

@@ -0,0 +1,14 @@
-------------------------------------------------------------------
Thu Dec 19 13:50:59 UTC 2024 - Matwey Kornilov <matwey.kornilov@gmail.com>
- Run unit tests for all available python versions
-------------------------------------------------------------------
Mon May 27 17:29:38 UTC 2024 - Andreas Schwab <schwab@suse.de>
- cxx-flags.patch: Remove unsupported compiler flag
-------------------------------------------------------------------
Mon May 6 13:29:15 UTC 2024 - Matwey Kornilov <matwey.kornilov@gmail.com>
- Initial version

125
xtensor-python.spec Normal file
View File

@@ -0,0 +1,125 @@
#
# spec file for package xtensor-python
#
# 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/
#
Name: xtensor-python
Version: 0.27.0
Release: 0
Summary: Python bindings for the xtensor C++ multi-dimensional array library
License: BSD-3-Clause
URL: https://github.com/xtensor-stack/xtensor-python
Source0: https://github.com/xtensor-stack/xtensor-python/archive/refs/tags/%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-Install-as-arch-independent.patch
Patch1: cxx-flags.patch
BuildRequires: %{python_module breathe}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{pythons}
BuildRequires: cmake
BuildRequires: doctest-devel
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gtest
BuildRequires: make
BuildRequires: python-rpm-macros
BuildRequires: xtensor-devel >= 0.25.0
BuildRequires: cmake(pybind11) >= 2.6.1
Group: Development/Libraries/C and C++
%description
Enables inplace use of numpy arrays in C++ with all the benefits from xtensor:
* C++ universal function and broadcasting,
* STL - compliant APIs,
* A broad coverage of numpy APIs.
The Python bindings for xtensor are based on the pybind11 C++ library, which
enables seamless interoperability between C++ and Python.
%package devel
Summary: Development files for xtensor-python
BuildArch: noarch
Requires: xtensor-devel
%description devel
Enables inplace use of numpy arrays in C++ with all the benefits from xtensor:
* C++ universal function and broadcasting,
* STL - compliant APIs,
* A broad coverage of numpy APIs.
The Python bindings for xtensor are based on the pybind11 C++ library, which
enables seamless interoperability between C++ and Python.
%package doc
Summary: Documentation for xtensor-python
Group: Documentation/HTML
BuildArch: noarch
%description doc
Enables inplace use of numpy arrays in C++ with all the benefits from xtensor:
* C++ universal function and broadcasting,
* STL - compliant APIs,
* A broad coverage of numpy APIs.
The Python bindings for xtensor are based on the pybind11 C++ library, which
enables seamless interoperability between C++ and Python.
%prep
%autosetup -p1
%build
%define __builddir build
%cmake
%cmake_build
# build documentation
make -C %{_builddir}/%{buildsubdir}/docs html
# build unit tests for each available python version
%{python_expand #
cd %{_builddir}/%{buildsubdir}
%define __builddir build.$python
%cmake -DBUILD_TESTS:BOOL=ON -DPYTHON_EXECUTABLE=%{_bindir}/$python
%cmake_build
}
%install
%define __builddir build
%cmake_install
# install documentation
mkdir -p %{buildroot}/%{_docdir}/%{name}
cp -r %{_builddir}/%{buildsubdir}/docs/build/html/* %{buildroot}/%{_docdir}/%{name}
%fdupes -s %{buildroot}/%{_docdir}
%check
# run unit tests
%{python_expand #
%cmake_build -C %{_builddir}/%{buildsubdir}/build.$python xtest
}
%files doc
%doc %{_docdir}/%{name}
%files devel
%license LICENSE
%{_includedir}/xtensor-python
%{_datadir}/cmake/xtensor-python
%changelog