Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ dependencies:
- libpdal-core
- compilers
- python
- pip
- scikit-build-core
- pybind11
- cmake
- ninja
- uv
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v8.3.1
with:
enable-cache: true

- name: Setup micromamba
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -49,12 +54,14 @@ jobs:
- name: Install Numpy ${{ matrix.numpy-version }}
shell: bash -l {0}
run: |
mamba install numpy=${{ matrix.numpy-version }}
PYTHON=$(python -c 'import sys; print(sys.executable)')
uv pip install --python "$PYTHON" --reinstall "numpy==${{ matrix.numpy-version }}.*"

- name: Install
shell: bash -l {0}
run: |
pip install . -Ccmake.define.WITH_TESTS=ON .
PYTHON=$(python -c 'import sys; print(sys.executable)')
uv pip install --python "$PYTHON" --no-build-isolation -Ccmake.define.WITH_TESTS=ON .

- name: Test Unix
shell: bash -l {0}
Expand All @@ -76,8 +83,8 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install pkg-config libssl-dev -y
python -m pip install build pipx twine
pipx run build --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
PYTHON=$(python -c 'import sys; print(sys.executable)')
uv build --python "$PYTHON" --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON

- name: Test Windows
if: matrix.os == 'windows-latest'
Expand All @@ -93,5 +100,3 @@ jobs:
pdal --drivers
$PDAL_DRIVER_PATH/pdal_filters_python_test$EXT
$PDAL_DRIVER_PATH/pdal_io_numpy_test$EXT


13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
fail-fast: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v8
with:
enable-cache: true

- name: Setup micromamba
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -33,11 +38,11 @@ jobs:
auto-update-conda: true
environment-file: .github/environment.yml

- name: Install dependencies
- name: Build source distribution
shell: bash -l {0}
run: |
python -m pip install build pipx twine
pipx run build --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
PYTHON=$(python -c 'import sys; print(sys.executable)')
uv build --python "$PYTHON" --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON

- name: Publish package distributions to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.vscode/
.venv/
_skbuild/
MANIFEST
build/
build-*/
dist/
wheels/
*.egg-info/
*.o
*.so
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13.0)
cmake_minimum_required(VERSION 3.15.0)
project(pdal-python-plugins VERSION ${SKBUILD_PROJECT_VERSION}
DESCRIPTION "PDAL Python Plugins"
HOMEPAGE_URL "https://github.com/PDAL/python-plugins")
Expand All @@ -15,8 +15,8 @@ set(Python3_FIND_FRAMEWORK "LAST")
find_package(Python3 COMPONENTS Interpreter Development.Module Development.Embed NumPy REQUIRED)


# find PDAL. Require 2.1+
find_package(PDAL 2.6 REQUIRED)
# find PDAL.
find_package(PDAL 2.7 REQUIRED)

# Taken and adapted from PDAL's cmake macros.cmake

Expand Down
54 changes: 49 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PDAL Python Plugins
PDAL Python plugins allow you to process data with PDAL into
`Numpy <http://www.numpy.org/>`__ arrays.
They support embedding Python in PDAL pipelines with the
`readers.numpy <https://pdal.io/stages/readers.numpy.html>`__ and
`filters.python <https://pdal.io/stages/filters.python.html>`__ stages.
`readers.numpy <https://pdal.org/stages/readers.numpy.html>`__ and
`filters.python <https://pdal.org/stages/filters.python.html>`__ stages.

Installation
--------------------------------------------------------------------------------
Expand All @@ -18,7 +18,9 @@ PDAL Python plugins are installable via PyPI:

.. code-block::

pip install pdal-plugins
uv pip install pdal-plugins

If you are not using uv, :code:`pip install pdal-plugins` works too.

GitHub
................................................................................
Expand All @@ -33,5 +35,47 @@ Requirements

* PDAL 2.6+
* Python >=3.9
* Numpy (eg :code:`pip install numpy`)
* scikit-build-core (eg :code:`pip install scikit-build-core`)
* uv
* Numpy
* scikit-build-core
* pybind11
* CMake and Ninja

Development
================================================================================

The project uses uv for Python package installation and builds, with
scikit-build-core driving the CMake build.

Create a development environment with the same dependencies used by CI:

.. code-block:: bash

mamba env create -f .github/environment.yml
mamba activate test

Install the plugins into that environment and build the C++ tests:

.. code-block:: bash

PYTHON=$(python -c 'import sys; print(sys.executable)')
uv pip install --python "$PYTHON" --no-build-isolation -Ccmake.define.WITH_TESTS=ON .

Run the tests from the scikit-build output directory:

.. code-block:: bash

export PYTHONHOME=$CONDA_PREFIX
export PATH=$CONDA_PREFIX/bin:$PATH
export WHEEL_DIR=$(python -m scikit_build_core.builder.wheel_tag)
export PDAL_DRIVER_PATH=$(pwd)/build/$WHEEL_DIR/Release
pdal --drivers
$PDAL_DRIVER_PATH/pdal_filters_python_test
$PDAL_DRIVER_PATH/pdal_io_numpy_test

Build source and wheel distributions with uv:

.. code-block:: bash

PYTHON=$(python -c 'import sys; print(sys.executable)')
uv build --python "$PYTHON"
21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,38 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: GIS",
]

dependencies = [
"numpy >= 1.22"
]

version="1.6.6"
version="1.6.7"

[project.optional-dependencies]
test = [ ]

[dependency-groups]
build = [
"numpy >= 1.22",
"pybind11[global]",
"scikit-build-core",
]
test = [ ]

[tool.uv]
package = true

[tool.setuptools]
package-dir = {"" = "src"}
zip-safe = false

[project.urls]
homepage = "https://pdal.io"
documentation = "https://pdal.io"
homepage = "https://pdal.org"
documentation = "https://pdal.org"
repository = "https://github.com/PDAL/python-plugins"
changelog = "https://github.com/PDAL/python-plugins/blob/main/README.rst"

Expand All @@ -62,7 +75,7 @@ sdist.include = [
"src",
"CMakeLists.txt"
]
cmake.verbose = true
build.verbose = true
logging.level = "INFO"

#[tool.scikit-build.cmake.define]
Expand Down
1 change: 0 additions & 1 deletion src/pdal/filters/PythonFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#pragma once

#include <pdal/Filter.hpp>
#include <pdal/JsonFwd.hpp>

#include "../plang/Invocation.hpp"

Expand Down
Loading