[xtensor-python] 01/02: Initial debianisation
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Apr 10 19:26:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository xtensor-python.
commit 1c245d3ff8ec9e412d8bcddcdc58dc0c0a946f6b
Author: Ghislain Antony Vaillant <ghisvail at gmail.com>
Date: Mon Apr 10 19:00:37 2017 +0100
Initial debianisation
---
debian/changelog | 5 +
debian/compat | 1 +
debian/control | 66 +++++++++++++
debian/copyright | 37 ++++++++
debian/gbp.conf | 7 ++
...Support-pybind11-2.0-for-Debian-packaging.patch | 102 +++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 40 ++++++++
debian/source/format | 1 +
debian/tests/control | 33 +++++++
debian/watch | 3 +
debian/xtensor-python-dev.install | 2 +
debian/xtensor-python-doc.doc-base | 9 ++
debian/xtensor-python-doc.docs | 1 +
14 files changed, 308 insertions(+)
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..848d838
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+xtensor-python (0.9.2-1) UNRELEASED; urgency=low
+
+ * Initial release. (Closes: #858068)
+
+ -- Ghislain Antony Vaillant <ghisvail at gmail.com> Mon, 10 Apr 2017 19:01:00 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..bb284b2
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,66 @@
+Source: xtensor-python
+Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders: Ghislain Antony Vaillant <ghisvail at gmail.com>
+Section: libs
+Priority: optional
+Build-Depends: cmake (>= 3.1),
+ debhelper (>= 10),
+ dpkg-dev (>= 1.17.14),
+ googletest <!nocheck>,
+ pybind11-dev (>= 2.0.0) <!nocheck>,
+ python3-breathe <!nodoc>,
+ python3-dev <!nocheck>,
+ python3-numpy <!nocheck>,
+ python3-sphinx <!nodoc>,
+ python3-sphinx-rtd-theme <!nodoc>,
+ sphinx-common,
+ xtensor-dev (>= 0.8.1) <!nocheck>
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/git/debian-science/packages/xtensor-python.git
+Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/xtensor-python.git
+Homepage: http://quantstack.net/xtensor
+
+Package: xtensor-python-dev
+Architecture: all
+Depends: ${misc:Depends},
+ pybind11-dev (>= 2.0.0),
+ xtensor-dev (>= 0.8.1)
+Suggests: xtensor-python-doc <!nodoc>
+Description: Python bindings for the xtensor library
+ xtensor is a C++ library for multi-dimensional arrays enabling numpy-style
+ broadcasting and lazy computing.
+ .
+ xtensor-python 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 (see the numpy to xtensor cheat sheet).
+ .
+ The Python bindings for xtensor are based on the pybind11 C++ library, which
+ enables seemless interoperability between C++ and Python.
+ .
+ This package provides the header-only library.
+
+Package: xtensor-python-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends},
+ ${sphinxdoc:Depends}
+Built-Using: ${sphinxdoc:Built-Using}
+Description: documentation for xtensor-python
+ xtensor is a C++ library for multi-dimensional arrays enabling numpy-style
+ broadcasting and lazy computing.
+ .
+ xtensor-python 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 (see the numpy to xtensor cheat sheet).
+ .
+ The Python bindings for xtensor are based on the pybind11 C++ library, which
+ enables seemless interoperability between C++ and Python.
+ .
+ This package provides the documentation.
+Build-Profiles: <!nodoc>
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..d7b4e03
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,37 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: xtensor-python
+Source: https://github.com/QuantStack/xtensor-python
+
+Files: *
+Copyright: 2016 Johan Mabille and Sylvain Corlay
+License: BSD-3-Clause
+
+Files: debian/*
+Copyright: 2017 Ghislain Antony Vaillant
+License: BSD-3-Clause
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ 1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ .
+ 3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..f53906f
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,7 @@
+[DEFAULT]
+upstream-branch = upstream
+debian-branch = master
+upstream-tag = upstream/%(version)s
+debian-tag = debian/%(version)s
+sign-tags = True
+pristine-tar = True
diff --git a/debian/patches/Support-pybind11-2.0-for-Debian-packaging.patch b/debian/patches/Support-pybind11-2.0-for-Debian-packaging.patch
new file mode 100644
index 0000000..3c80a72
--- /dev/null
+++ b/debian/patches/Support-pybind11-2.0-for-Debian-packaging.patch
@@ -0,0 +1,102 @@
+From: Sylvain Corlay <sylvain.corlay at gmail.com>
+Date: Thu, 6 Apr 2017 19:30:22 +0200
+Subject: Support pybind11 2.0 for Debian packaging
+
+---
+ .appveyor.yml | 7 ++-----
+ .travis.yml | 7 ++-----
+ include/xtensor-python/pycontainer.hpp | 30 +++++++++++++++++++++++++++++-
+ 3 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/.appveyor.yml b/.appveyor.yml
+index 9090b34..7141d5d 100644
+--- a/.appveyor.yml
++++ b/.appveyor.yml
+@@ -23,13 +23,10 @@ install:
+ - conda update -q conda
+ - conda info -a
+ - conda install gtest cmake -c conda-forge
+- - conda install xtensor==0.8.3 pytest numpy pybind11==2.1.1 -c conda-forge
++ - conda install xtensor==0.8.3 pytest numpy pybind11==2.0.1 -c conda-forge
+ - "set PYTHONHOME=%MINICONDA%"
+- - cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=ON -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe .
+- - nmake test_xtensor_python
++ - cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\Library -D BUILD_TESTS=OFF -D PYTHON_EXECUTABLE=%MINICONDA%\\python.exe .
+ - nmake install
+
+ build_script:
+ - py.test -s
+- - cd test
+- - .\test_xtensor_python
+diff --git a/.travis.yml b/.travis.yml
+index 6a65ae9..2cb0905 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -94,17 +94,14 @@ install:
+ - conda update -q conda
+ # Useful for debugging any issues with conda
+ - conda info -a
+- - conda install xtensor==0.8.3 pytest numpy pybind11==2.1.1 -c conda-forge
++ - conda install xtensor==0.8.3 pytest numpy pybind11==2.0.1 -c conda-forge
+ - cd test
+ - conda env create -f ./test-environment.yml
+ - source activate test-xtensor-python
+ - cd ..
+- - cmake -D BUILD_TESTS=ON -D CMAKE_INSTALL_PREFIX=$HOME/miniconda .
+- - make -j2 test_xtensor_python
++ - cmake -D BUILD_TESTS=OFF -D CMAKE_INSTALL_PREFIX=$HOME/miniconda .
+ - make install
+
+ script:
+ - py.test -s
+- - cd test
+- - ./test_xtensor_python
+
+diff --git a/include/xtensor-python/pycontainer.hpp b/include/xtensor-python/pycontainer.hpp
+index 0cd5257..38c8c56 100644
+--- a/include/xtensor-python/pycontainer.hpp
++++ b/include/xtensor-python/pycontainer.hpp
+@@ -113,6 +113,34 @@ namespace xt
+
+ namespace detail
+ {
++
++ template <typename T, typename SFINAE = void>
++ struct is_fmt_numeric
++ {
++ static constexpr bool value = false;
++ };
++
++ constexpr int log2(size_t n, int k = 0)
++ {
++ return (n <= 1) ? k : log2(n >> 1, k + 1);
++ }
++
++ template <typename T>
++ struct is_fmt_numeric<T, std::enable_if_t<std::is_arithmetic<T>::value>>
++ {
++ static constexpr bool value = true;
++ static constexpr int index = std::is_same<T, bool>::value ? 0 : 1 + (
++ std::is_integral<T>::value ? log2(sizeof(T)) * 2 + std::is_unsigned<T>::value : 8 + (
++ std::is_same<T, double>::value ? 1 : std::is_same<T, long double>::value ? 2 : 0));
++ };
++
++ template <class T>
++ struct is_fmt_numeric<std::complex<T>>
++ {
++ static constexpr bool value = true;
++ static constexpr int index = is_fmt_numeric<T>::index + 3;
++ };
++
+ template <class T>
+ struct numpy_traits
+ {
+@@ -130,7 +158,7 @@ namespace xt
+
+ using value_type = std::remove_const_t<T>;
+
+- static constexpr int type_num = value_list[pybind11::detail::is_fmt_numeric<value_type>::index];
++ static constexpr int type_num = value_list[is_fmt_numeric<value_type>::index];
+ };
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1685e8b
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+Support-pybind11-2.0-for-Debian-packaging.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..c060049
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,40 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE = 1
+
+BUILD_OPTIONS = -DXTENSOR_PYTHON_CMAKECONFIG_INSTALL_DIR="lib/cmake/xtensor-python"
+
+ifeq (,$(findstring nocheck,$(DEB_BUILD_PROFILES)))
+BUILD_OPTIONS += -DBUILD_TESTS=ON \
+ -DGTEST_SRC_DIR="/usr/src/googletest" \
+ -DPYTHON_EXECUTABLE="/usr/bin/python3"
+else
+BUILD_OPTIONS += -DBUILD_TESTS=OFF
+endif
+
+%:
+ dh $@ --with sphinxdoc
+
+override_dh_auto_clean:
+ dh_auto_clean
+ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
+ $(MAKE) -C docs clean
+endif
+
+override_dh_auto_configure:
+ dh_auto_configure -- $(BUILD_OPTIONS)
+
+override_dh_auto_build:
+ dh_auto_build
+ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
+ $(MAKE) -C docs html
+endif
+
+override_dh_auto_test:
+ifeq (,$(findstring nocheck,$(DEB_BUILD_PROFILES)))
+ dh_auto_test -- xtest
+endif
+
+override_dh_auto_install:
+ dh_auto_install --destdir=debian/tmp
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..219c58c
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,33 @@
+Test-Command: set -e
+ ; cp -r test/* "$AUTOPKGTEST_TMP"
+ ; for py in $(py3versions -r 2>/dev/null)
+ ; do cd "$AUTOPKGTEST_TMP"
+ ; mkdir build && cd build
+ ; echo "Testing with gcc and $py:"
+ ; CC=gcc CXX=g++ cmake -DGTEST_SRC_DIR="/usr/src/googletest" -DPYTHON_EXECUTABLE="/usr/bin/$py" ..
+ ; make -j $(nproc) xtest
+ ; done
+Depends: cmake,
+ g++,
+ googletest,
+ python3-all-dev,
+ python3-numpy,
+ xtensor-python-dev
+Restrictions: allow-stderr
+
+Test-Command: set -e
+ ; cp -r test/* "$AUTOPKGTEST_TMP"
+ ; for py in $(py3versions -r 2>/dev/null)
+ ; do cd "$AUTOPKGTEST_TMP"
+ ; mkdir build && cd build
+ ; echo "Testing with clang and $py:"
+ ; CC=clang CXX=clang++ cmake -DGTEST_SRC_DIR="/usr/src/googletest" -DPYTHON_EXECUTABLE="/usr/bin/$py" ..
+ ; make -j $(nproc) xtest
+ ; done
+Depends: clang,
+ cmake,
+ googletest,
+ python3-all-dev,
+ python3-numpy,
+ xtensor-python-dev
+Restrictions: allow-stderr
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..240f968
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/xtensor-python-$1\.tar\.gz/ \
+https://github.com/QuantStack/xtensor-python/tags .*/v?(\d\S*)\.tar\.gz
diff --git a/debian/xtensor-python-dev.install b/debian/xtensor-python-dev.install
new file mode 100644
index 0000000..b7ac0bd
--- /dev/null
+++ b/debian/xtensor-python-dev.install
@@ -0,0 +1,2 @@
+usr/include/xtensor-python
+usr/lib/cmake/xtensor-python
diff --git a/debian/xtensor-python-doc.doc-base b/debian/xtensor-python-doc.doc-base
new file mode 100644
index 0000000..a076d8d
--- /dev/null
+++ b/debian/xtensor-python-doc.doc-base
@@ -0,0 +1,9 @@
+Document: xtensor-python-doc
+Title: xtensor-python documentation
+Author: Johan Mabille and Sylvain Corlay
+Abstract: This is the reference documentation for the xtensor-python library.
+Section: Programming/C++
+
+Format: HTML
+Index: /usr/share/doc/xtensor-python-doc/html/index.html
+Files: /usr/share/doc/xtensor-python-doc/html/*.html
diff --git a/debian/xtensor-python-doc.docs b/debian/xtensor-python-doc.docs
new file mode 100644
index 0000000..a213c54
--- /dev/null
+++ b/debian/xtensor-python-doc.docs
@@ -0,0 +1 @@
+docs/build/html
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/xtensor-python.git
More information about the debian-science-commits
mailing list