diff --git a/CMakeLists.txt b/CMakeLists.txt index e6b9227..1dba9ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ message(STATUS "xtensor-python v${${PROJECT_NAME}_VERSION}") # Dependencies # ============ -set(xtensor_REQUIRED_VERSION 0.26.0) +set(xtensor_REQUIRED_VERSION 0.27.0) if(TARGET xtensor) set(xtensor_VERSION ${XTENSOR_VERSION_MAJOR}.${XTENSOR_VERSION_MINOR}.${XTENSOR_VERSION_PATCH}) # Note: This is not SEMVER compatible comparison @@ -48,7 +48,7 @@ endif() find_package(Python COMPONENTS Interpreter REQUIRED) -set(pybind11_REQUIRED_VERSION 2.6.1) +set(pybind11_REQUIRED_VERSION 3.0.0) if (NOT TARGET pybind11::headers) # Defaults to ON for cmake >= 3.18 # https://github.com/pybind/pybind11/blob/35ff42b56e9d34d9a944266eb25f2c899dbdfed7/CMakeLists.txt#L96 @@ -124,13 +124,14 @@ export(EXPORT ${PROJECT_NAME}-targets install(FILES ${XTENSOR_PYTHON_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtensor-python) + configure_file(${PROJECT_NAME}.pc.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig/") -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 diff --git a/README.md b/README.md index acf2df1..fbe1946 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![GHA OSX](https://github.com/xtensor-stack/xtensor/actions/workflows/osx.yml/badge.svg)](https://github.com/xtensor-stack/xtensor/actions/workflows/osx.yml) [![GHA Windows](https://github.com/xtensor-stack/xtensor/actions/workflows/windows.yml/badge.svg)](https://github.com/xtensor-stack/xtensor/actions/workflows/windows.yml) [![Documentation](http://readthedocs.org/projects/xtensor-python/badge/?version=latest)](https://xtensor-python.readthedocs.io/en/latest/?badge=latest) -[![Join the Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/QuantStack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Zulip](https://img.shields.io/badge/social_chat-zulip-blue.svg)](https://xtensor.zulipchat.com/#narrow/channel/539553-Ask-anything) Python bindings for the [xtensor](https://github.com/xtensor-stack/xtensor) C++ multi-dimensional array library. @@ -204,7 +204,8 @@ from the `docs` subdirectory. | `xtensor-python` | `xtensor` | `pybind11` | |------------------|-----------|------------------| -| master | ^0.26.0 | >=2.6.1,<3 | +| master | ^0.27.0 | >=2.6.1,<4 | +| 0.29.0 | ^0.27.0 | >=2.6.1,<4 | | 0.28.0 | ^0.26.0 | >=2.6.1,<3 | | 0.27.0 | ^0.25.0 | >=2.6.1,<3 | | 0.26.1 | ^0.24.0 | ~2.4.3 | diff --git a/environment-dev.yml b/environment-dev.yml index 72275dd..4d3b27b 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -6,9 +6,9 @@ dependencies: - cmake - ninja # Host dependencies - - xtensor>=0.26,<0.27 + - xtensor>=0.27,<0.28 - numpy>=2.0 - - pybind11>=2.12.0,<3 + - pybind11>=2.12.0,<4 # Test dependencies - setuptools - pytest diff --git a/include/xtensor-python/pyarray.hpp b/include/xtensor-python/pyarray.hpp index 0854fb3..c24a793 100644 --- a/include/xtensor-python/pyarray.hpp +++ b/include/xtensor-python/pyarray.hpp @@ -195,7 +195,7 @@ namespace xt static self_type ensure(pybind11::handle h); static bool check_(pybind11::handle h); -#if PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3 +#if (PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3) || PYBIND11_VERSION_MAJOR >= 3 // Prevent ambiguous overload resolution for operators defined for // both xt::xcontainer_semantic and pybind11::object. using semantic_base::operator+=; diff --git a/include/xtensor-python/pycontainer.hpp b/include/xtensor-python/pycontainer.hpp index 5e80a32..f01c390 100644 --- a/include/xtensor-python/pycontainer.hpp +++ b/include/xtensor-python/pycontainer.hpp @@ -129,7 +129,7 @@ namespace xt private: -#if PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3 +#if (PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3) || PYBIND11_VERSION_MAJOR >= 3 // Prevent ambiguous overload resolution for operators defined for // both xt::xcontainer and pybind11::object. using pybind11::object::operator~; diff --git a/include/xtensor-python/pystrides_adaptor.hpp b/include/xtensor-python/pystrides_adaptor.hpp index fde929a..bde3923 100644 --- a/include/xtensor-python/pystrides_adaptor.hpp +++ b/include/xtensor-python/pystrides_adaptor.hpp @@ -89,6 +89,8 @@ namespace xt using iterator_category = std::random_access_iterator_tag; using shape_pointer = typename pystrides_adaptor::shape_type; + pystrides_iterator() = default; + inline pystrides_iterator(pointer current, shape_pointer shape) : p_current(current) , p_shape(shape) diff --git a/include/xtensor-python/pytensor.hpp b/include/xtensor-python/pytensor.hpp index 3eac157..e3746cc 100644 --- a/include/xtensor-python/pytensor.hpp +++ b/include/xtensor-python/pytensor.hpp @@ -214,7 +214,7 @@ namespace xt static self_type ensure(pybind11::handle h); static bool check_(pybind11::handle h); -#if PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3 +#if (PYBIND11_VERSION_MAJOR == 2 && PYBIND11_VERSION_MINOR >= 3) || (PYBIND11_VERSION_MAJOR >= 3) // Prevent ambiguous overload resolution for operators defined for // both xt::xcontainer_semantic and pybind11::object. using semantic_base::operator+=; diff --git a/include/xtensor-python/xtensor_python_config.hpp b/include/xtensor-python/xtensor_python_config.hpp index f6840a7..4bb0882 100644 --- a/include/xtensor-python/xtensor_python_config.hpp +++ b/include/xtensor-python/xtensor_python_config.hpp @@ -11,7 +11,7 @@ #define XTENSOR_PYTHON_CONFIG_HPP #define XTENSOR_PYTHON_VERSION_MAJOR 0 -#define XTENSOR_PYTHON_VERSION_MINOR 28 +#define XTENSOR_PYTHON_VERSION_MINOR 29 #define XTENSOR_PYTHON_VERSION_PATCH 0 #endif diff --git a/test_python/setup.py b/test_python/setup.py index 58dbd2d..895f60d 100644 --- a/test_python/setup.py +++ b/test_python/setup.py @@ -78,8 +78,8 @@ def cpp_flag(compiler): """Return the -std=c++17 compiler flag and errors when the flag is no available. """ - if has_flag(compiler, '-std=c++17'): - return '-std=c++17' + if has_flag(compiler, '-std=c++20'): + return '-std=c++20' else: raise RuntimeError('C++17 support is required by xtensor!') @@ -104,7 +104,7 @@ def build_extensions(self): opts.append('-fvisibility=hidden') elif ct == 'msvc': opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) - opts.append('/std:c++17') + opts.append('/std:c++20') for ext in self.extensions: ext.extra_compile_args = opts build_ext.build_extensions(self) diff --git a/test_python/test_pyarray.py b/test_python/test_pyarray.py index 9955ee7..4e7d5eb 100644 --- a/test_python/test_pyarray.py +++ b/test_python/test_pyarray.py @@ -23,7 +23,6 @@ import numpy as np class XtensorTest(TestCase): - """ def test_rm(self): xt.test_rm(np.array([10], dtype=int)) @@ -62,7 +61,6 @@ def test_example3(self): with self.assertRaises(TypeError): x = np.arange(3*2).reshape(3, 2) xt.example3_xfixed2(x) - """ def test_broadcast_addition(self): x = np.array([[2., 3., 4., 5.]]) y = np.array([[1., 2., 3., 4.], @@ -73,7 +71,6 @@ def test_broadcast_addition(self): [3., 5., 7., 9.]]) z = xt.array_addition(x, y) np.testing.assert_allclose(z, res, 1e-12) - """ def test_broadcast_subtraction(self): x = np.array([[4., 5., 6., 7.]]) y = np.array([[4., 3., 2., 1.], @@ -307,7 +304,6 @@ def test_native_casters(self): self.assertEqual(adapter.shape, (2, 2)) adapter[1, 1] = -3 self.assertEqual(arr[0, 5], -3) - """ class AttributeTest(TestCase):