Import package.
This commit is contained in:
parent
454f8e53b7
commit
1d3ad0b2db
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
|||||||
|
/v2.0.1.tar.gz
|
28
pybind11-2.0.1-byteorder.patch
Normal file
28
pybind11-2.0.1-byteorder.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
diff -up pybind11-2.0.1/tests/test_kwargs_and_defaults.py.699 pybind11-2.0.1/tests/test_kwargs_and_defaults.py
|
||||||
|
diff -up pybind11-2.0.1/tests/test_numpy_array.py.699 pybind11-2.0.1/tests/test_numpy_array.py
|
||||||
|
--- pybind11-2.0.1/tests/test_numpy_array.py.699 2017-02-26 13:32:20.014729539 -0800
|
||||||
|
+++ pybind11-2.0.1/tests/test_numpy_array.py 2017-02-26 13:34:13.621804603 -0800
|
||||||
|
@@ -6,7 +6,7 @@ with pytest.suppress(ImportError):
|
||||||
|
|
||||||
|
@pytest.fixture(scope='function')
|
||||||
|
def arr():
|
||||||
|
- return np.array([[1, 2, 3], [4, 5, 6]], '<u2')
|
||||||
|
+ return np.array([[1, 2, 3], [4, 5, 6]], '=u2')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.requires_numpy
|
||||||
|
@@ -82,10 +82,10 @@ def test_dim_check_fail(arr):
|
||||||
|
([1, 2], [6])])
|
||||||
|
def test_data(arr, args, ret):
|
||||||
|
from pybind11_tests.array import data, data_t
|
||||||
|
+ from sys import byteorder
|
||||||
|
assert all(data_t(arr, *args) == ret)
|
||||||
|
- assert all(data(arr, *args)[::2] == ret)
|
||||||
|
- assert all(data(arr, *args)[1::2] == 0)
|
||||||
|
-
|
||||||
|
+ assert all(data(arr, *args)[(0 if byteorder == 'little' else 1)::2] == ret)
|
||||||
|
+ assert all(data(arr, *args)[(1 if byteorder == 'little' else 0)::2] == 0)
|
||||||
|
|
||||||
|
@pytest.requires_numpy
|
||||||
|
def test_mutate_readonly(arr):
|
||||||
|
diff -up pybind11-2.0.1/tests/test_numpy_dtypes.py.699 pybind11-2.0.1/tests/test_numpy_dtypes.py
|
12
pybind11-2.0.1-tests.patch
Normal file
12
pybind11-2.0.1-tests.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up pybind11-2.0.1/tests/CMakeLists.txt.tests pybind11-2.0.1/tests/CMakeLists.txt
|
||||||
|
--- pybind11-2.0.1/tests/CMakeLists.txt.tests 2017-01-04 06:17:18.000000000 -0800
|
||||||
|
+++ pybind11-2.0.1/tests/CMakeLists.txt 2017-02-24 06:30:19.356044843 -0800
|
||||||
|
@@ -27,7 +27,7 @@ set(PYBIND11_TEST_FILES
|
||||||
|
test_modules.cpp
|
||||||
|
test_multiple_inheritance.cpp
|
||||||
|
test_numpy_array.cpp
|
||||||
|
- test_numpy_dtypes.cpp
|
||||||
|
+# test_numpy_dtypes.cpp
|
||||||
|
test_numpy_vectorize.cpp
|
||||||
|
test_opaque_types.cpp
|
||||||
|
test_operator_overloading.cpp
|
96
pybind11.spec
Normal file
96
pybind11.spec
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
# While the headers are architecture independent, the package must be
|
||||||
|
# built separately on all architectures so that the tests are run
|
||||||
|
# properly. See also
|
||||||
|
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
Name: pybind11
|
||||||
|
Version: 2.0.1
|
||||||
|
Release: 5%{?dist}
|
||||||
|
Summary: Seamless operability between C++11 and Python
|
||||||
|
License: BSD
|
||||||
|
URL: https://github.com/pybind/pybind11
|
||||||
|
Source0: https://github.com/pybind/pybind11/archive/v%{version}.tar.gz
|
||||||
|
|
||||||
|
# Disable numpy dtypes test as guided in https://github.com/pybind/pybind11/issues/694
|
||||||
|
Patch0: pybind11-2.0.1-tests.patch
|
||||||
|
# Fix tests that are broken on bigendian systems, adapted from https://github.com/pybind/pybind11/pull/699
|
||||||
|
Patch1: pybind11-2.0.1-byteorder.patch
|
||||||
|
|
||||||
|
# These are only needed for the checks
|
||||||
|
BuildRequires: python2-devel
|
||||||
|
BuildRequires: python2-pytest
|
||||||
|
BuildRequires: python2-numpy
|
||||||
|
BuildRequires: python2-scipy
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: python3-pytest
|
||||||
|
BuildRequires: python3-numpy
|
||||||
|
BuildRequires: python3-scipy
|
||||||
|
BuildRequires: eigen3-devel
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
BuildRequires: cmake
|
||||||
|
|
||||||
|
%description
|
||||||
|
pybind11 is a lightweight header-only library that exposes C++ types
|
||||||
|
in Python and vice versa, mainly to create Python bindings of existing
|
||||||
|
C++ code.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development headers for pybind11
|
||||||
|
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_Header_Only_Libraries
|
||||||
|
Provides: %{name}-static = %{version}-%{release}
|
||||||
|
# For dir ownership
|
||||||
|
Requires: cmake
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
pybind11 is a lightweight header-only library that exposes C++ types
|
||||||
|
in Python and vice versa, mainly to create Python bindings of existing
|
||||||
|
C++ code.
|
||||||
|
|
||||||
|
This package contains the development headers for pybind11.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
%patch0 -p1 -b .tests
|
||||||
|
%patch1 -p1 -b .order
|
||||||
|
|
||||||
|
%build
|
||||||
|
for py in python2 python3; do
|
||||||
|
mkdir $py
|
||||||
|
cd $py
|
||||||
|
%cmake .. -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/$py
|
||||||
|
make %{?_smp_mflags}
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
|
%check
|
||||||
|
make -C python2 check %{?_smp_mflags}
|
||||||
|
make -C python3 check %{?_smp_mflags}
|
||||||
|
|
||||||
|
%install
|
||||||
|
%make_install -C python2
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.md
|
||||||
|
%{_includedir}/pybind11/
|
||||||
|
%{_datadir}/cmake/pybind11/
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Feb 27 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-5
|
||||||
|
- Full compliance with header only libraries guidelines.
|
||||||
|
|
||||||
|
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-4
|
||||||
|
- As advised by upstream, disable dtypes test for now.
|
||||||
|
- Include patch for tests on bigendian systems.
|
||||||
|
|
||||||
|
* Thu Feb 23 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-3
|
||||||
|
- Make the package arched so that tests can be run on all architectures.
|
||||||
|
- Run tests both against python2 and python3.
|
||||||
|
|
||||||
|
* Wed Feb 22 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-2
|
||||||
|
- Switch to python3 for tests.
|
||||||
|
|
||||||
|
* Sun Feb 05 2017 Susi Lehtola <jussilehtola@fedorapeople.org> - 2.0.1-1
|
||||||
|
- First release.
|
Loading…
Reference in New Issue
Block a user