From 3d16417044506ab04deb9e4247fcaf25019da27c Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Tue, 18 Jun 2024 10:03:49 -0500 Subject: [PATCH 1/2] handle ABI < 2 (#171) --- src/pdal/PyArray.cpp | 4 ++++ src/pdal/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pdal/PyArray.cpp b/src/pdal/PyArray.cpp index d3521173..55f87b5d 100644 --- a/src/pdal/PyArray.cpp +++ b/src/pdal/PyArray.cpp @@ -90,6 +90,10 @@ std::string toString(PyObject *pname) } // unnamed namespace +#if NPY_ABI_VERSION < 0x02000000 + #define PyDataType_FIELDS(descr) ((descr)->fields) +#endif + Array::Array(PyArrayObject* array) : m_array(array), m_rowMajor(true) { Py_XINCREF(array); diff --git a/src/pdal/__init__.py b/src/pdal/__init__.py index 41b36121..a312f568 100644 --- a/src/pdal/__init__.py +++ b/src/pdal/__init__.py @@ -1,5 +1,5 @@ __all__ = ["Pipeline", "Stage", "Reader", "Filter", "Writer", "dimensions", "info"] -__version__ = '3.4.4' +__version__ = '3.4.5' from . import libpdalpython from .drivers import inject_pdal_drivers From 4205f3dac0de7b4cb276f262159b7ffe1fb46cde Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Tue, 18 Jun 2024 12:39:15 -0500 Subject: [PATCH 2/2] parameterize numpy testing (#172) * parameterize numpy * typo * specify numpy * exclude 3.12 + 1.22 * typo * more precise exclude * ID the job * increase to 1.24 --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42c82a78..47180b8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ defaults: jobs: build: - name: Build ${{ matrix.os }} py${{ matrix.python-version }} + name: ${{ matrix.os }} py${{ matrix.python-version }} numpy ${{ matrix.numpy-version }} runs-on: ${{ matrix.os }} strategy: @@ -25,6 +25,10 @@ jobs: matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] python-version: ['3.9', '3.10', '3.11', '3.12'] + numpy-version: ['1.24', '2.0'] + exclude: + - python-version: '3.12' + numpy-version: '1.24' steps: - name: Check out python-pdal @@ -47,6 +51,10 @@ jobs: auto-update-conda: true environment-file: .github/environment.yml + - name: Install numpy ${{ matrix.numpy-version }} + run: | + mamba install -y numpy=${{ matrix.numpy-version }} + - name: Install python-pdal run: | pip install -vv . --no-deps --no-build-isolation