Skip to content

Commit 53c6171

Browse files
committed
convert to using uv
1 parent 683f815 commit 53c6171

6 files changed

Lines changed: 85 additions & 16 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
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

README.rst

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ 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
88
`readers.numpy <https://pdal.org/stages/readers.numpy.html>`__ and
9-
`filters.python <https://pdal.orgo/stages/filters.python.html>`__ stages.
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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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",
2526
"Topic :: Scientific/Engineering :: GIS",
2627
]
2728

@@ -34,6 +35,17 @@ version="1.6.7"
3435
[project.optional-dependencies]
3536
test = [ ]
3637

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

0 commit comments

Comments
 (0)