Skip to content

Commit de04995

Browse files
authored
catch up to new scikit-build-core (#15)
* catch up to new scikit-build-core * align PDAL dep with pdal-python * drop JsonFwd * convert to using uv * advertise 3.14 too * set uv action pin
1 parent 53fa073 commit de04995

8 files changed

Lines changed: 94 additions & 25 deletions

File tree

.github/environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ dependencies:
77
- libpdal-core
88
- compilers
99
- python
10-
- pip
11-
- scikit-build-core
1210
- pybind11
1311
- cmake
1412
- ninja
13+
- uv

.github/workflows/build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
- name: Check out
3737
uses: actions/checkout@v4
3838

39+
- name: Install uv
40+
uses: astral-sh/setup-uv@v8.3.1
41+
with:
42+
enable-cache: true
43+
3944
- name: Setup micromamba
4045
uses: conda-incubator/setup-miniconda@v3
4146
with:
@@ -49,12 +54,14 @@ jobs:
4954
- name: Install Numpy ${{ matrix.numpy-version }}
5055
shell: bash -l {0}
5156
run: |
52-
mamba install numpy=${{ matrix.numpy-version }}
57+
PYTHON=$(python -c 'import sys; print(sys.executable)')
58+
uv pip install --python "$PYTHON" --reinstall "numpy==${{ matrix.numpy-version }}.*"
5359
5460
- name: Install
5561
shell: bash -l {0}
5662
run: |
57-
pip install . -Ccmake.define.WITH_TESTS=ON .
63+
PYTHON=$(python -c 'import sys; print(sys.executable)')
64+
uv pip install --python "$PYTHON" --no-build-isolation -Ccmake.define.WITH_TESTS=ON .
5865
5966
- name: Test Unix
6067
shell: bash -l {0}
@@ -76,8 +83,8 @@ jobs:
7683
run: |
7784
sudo apt-get update -y
7885
sudo apt-get install pkg-config libssl-dev -y
79-
python -m pip install build pipx twine
80-
pipx run build --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
86+
PYTHON=$(python -c 'import sys; print(sys.executable)')
87+
uv build --python "$PYTHON" --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
8188
8289
- name: Test Windows
8390
if: matrix.os == 'windows-latest'
@@ -93,5 +100,3 @@ jobs:
93100
pdal --drivers
94101
$PDAL_DRIVER_PATH/pdal_filters_python_test$EXT
95102
$PDAL_DRIVER_PATH/pdal_io_numpy_test$EXT
96-
97-

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ jobs:
2222
fail-fast: true
2323

2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v8
28+
with:
29+
enable-cache: true
30+
2631
- name: Setup micromamba
2732
uses: conda-incubator/setup-miniconda@v3
2833
with:
@@ -33,11 +38,11 @@ jobs:
3338
auto-update-conda: true
3439
environment-file: .github/environment.yml
3540

36-
- name: Install dependencies
41+
- name: Build source distribution
3742
shell: bash -l {0}
3843
run: |
39-
python -m pip install build pipx twine
40-
pipx run build --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
44+
PYTHON=$(python -c 'import sys; print(sys.executable)')
45+
uv build --python "$PYTHON" --sdist -Ccmake.define.CMAKE_BUILD_WITH_INSTALL_RPATH=ON
4146
4247
- name: Publish package distributions to PyPI
4348
if: github.event_name == 'release' && github.event.action == 'published'

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
.vscode/
2+
.venv/
23
_skbuild/
34
MANIFEST
5+
build/
6+
build-*/
47
dist/
8+
wheels/
59
*.egg-info/
610
*.o
711
*.so

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.13.0)
1+
cmake_minimum_required(VERSION 3.15.0)
22
project(pdal-python-plugins VERSION ${SKBUILD_PROJECT_VERSION}
33
DESCRIPTION "PDAL Python Plugins"
44
HOMEPAGE_URL "https://github.com/PDAL/python-plugins")
@@ -15,8 +15,8 @@ set(Python3_FIND_FRAMEWORK "LAST")
1515
find_package(Python3 COMPONENTS Interpreter Development.Module Development.Embed NumPy REQUIRED)
1616

1717

18-
# find PDAL. Require 2.1+
19-
find_package(PDAL 2.6 REQUIRED)
18+
# find PDAL.
19+
find_package(PDAL 2.7 REQUIRED)
2020

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

README.rst

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ PDAL Python Plugins
55
PDAL Python plugins allow you to process data with PDAL into
66
`Numpy <http://www.numpy.org/>`__ arrays.
77
They support embedding Python in PDAL pipelines with the
8-
`readers.numpy <https://pdal.io/stages/readers.numpy.html>`__ and
9-
`filters.python <https://pdal.io/stages/filters.python.html>`__ stages.
8+
`readers.numpy <https://pdal.org/stages/readers.numpy.html>`__ and
9+
`filters.python <https://pdal.org/stages/filters.python.html>`__ stages.
1010

1111
Installation
1212
--------------------------------------------------------------------------------
@@ -18,7 +18,9 @@ PDAL Python plugins are installable via PyPI:
1818

1919
.. code-block::
2020
21-
pip install pdal-plugins
21+
uv pip install pdal-plugins
22+
23+
If you are not using uv, :code:`pip install pdal-plugins` works too.
2224

2325
GitHub
2426
................................................................................
@@ -33,5 +35,47 @@ Requirements
3335

3436
* PDAL 2.6+
3537
* Python >=3.9
36-
* Numpy (eg :code:`pip install numpy`)
37-
* scikit-build-core (eg :code:`pip install scikit-build-core`)
38+
* uv
39+
* Numpy
40+
* scikit-build-core
41+
* pybind11
42+
* CMake and Ninja
43+
44+
Development
45+
================================================================================
46+
47+
The project uses uv for Python package installation and builds, with
48+
scikit-build-core driving the CMake build.
49+
50+
Create a development environment with the same dependencies used by CI:
51+
52+
.. code-block:: bash
53+
54+
mamba env create -f .github/environment.yml
55+
mamba activate test
56+
57+
Install the plugins into that environment and build the C++ tests:
58+
59+
.. code-block:: bash
60+
61+
PYTHON=$(python -c 'import sys; print(sys.executable)')
62+
uv pip install --python "$PYTHON" --no-build-isolation -Ccmake.define.WITH_TESTS=ON .
63+
64+
Run the tests from the scikit-build output directory:
65+
66+
.. code-block:: bash
67+
68+
export PYTHONHOME=$CONDA_PREFIX
69+
export PATH=$CONDA_PREFIX/bin:$PATH
70+
export WHEEL_DIR=$(python -m scikit_build_core.builder.wheel_tag)
71+
export PDAL_DRIVER_PATH=$(pwd)/build/$WHEEL_DIR/Release
72+
pdal --drivers
73+
$PDAL_DRIVER_PATH/pdal_filters_python_test
74+
$PDAL_DRIVER_PATH/pdal_io_numpy_test
75+
76+
Build source and wheel distributions with uv:
77+
78+
.. code-block:: bash
79+
80+
PYTHON=$(python -c 'import sys; print(sys.executable)')
81+
uv build --python "$PYTHON"

pyproject.toml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,38 @@ classifiers = [
2222
"Programming Language :: Python :: 3.10",
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
2527
"Topic :: Scientific/Engineering :: GIS",
2628
]
2729

2830
dependencies = [
2931
"numpy >= 1.22"
3032
]
3133

32-
version="1.6.6"
34+
version="1.6.7"
3335

3436
[project.optional-dependencies]
3537
test = [ ]
3638

39+
[dependency-groups]
40+
build = [
41+
"numpy >= 1.22",
42+
"pybind11[global]",
43+
"scikit-build-core",
44+
]
45+
test = [ ]
46+
47+
[tool.uv]
48+
package = true
49+
3750
[tool.setuptools]
3851
package-dir = {"" = "src"}
3952
zip-safe = false
4053

4154
[project.urls]
42-
homepage = "https://pdal.io"
43-
documentation = "https://pdal.io"
55+
homepage = "https://pdal.org"
56+
documentation = "https://pdal.org"
4457
repository = "https://github.com/PDAL/python-plugins"
4558
changelog = "https://github.com/PDAL/python-plugins/blob/main/README.rst"
4659

@@ -62,7 +75,7 @@ sdist.include = [
6275
"src",
6376
"CMakeLists.txt"
6477
]
65-
cmake.verbose = true
78+
build.verbose = true
6679
logging.level = "INFO"
6780

6881
#[tool.scikit-build.cmake.define]

src/pdal/filters/PythonFilter.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#pragma once
3636

3737
#include <pdal/Filter.hpp>
38-
#include <pdal/JsonFwd.hpp>
3938

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

0 commit comments

Comments
 (0)