Skip to content

Commit

Permalink
modernize with scikit-build-core
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Apr 15, 2024
1 parent dc8b1b5 commit 34c9988
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 9 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
release:
types:
- published

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/pdal
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install build
pip install build twine
python -m build . --sdist
- name: Publish package distributions to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ endif()
find_package(Python3 COMPONENTS Interpreter ${DEVELOPMENT_COMPONENT} NumPy REQUIRED)

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

# find PyBind11
find_package(pybind11 REQUIRED)

set(extension "libpdalpython")
pybind11_add_module(${extension} MODULE
pdal/PyArray.cpp
pdal/PyPipeline.cpp
pdal/StreamableExecutor.cpp
pdal/libpdalpython.cpp
src/pdal/PyArray.cpp
src/pdal/PyPipeline.cpp
src/pdal/StreamableExecutor.cpp
src/pdal/libpdalpython.cpp
)
target_include_directories(${extension} PRIVATE ${Python3_NumPy_INCLUDE_DIRS})
target_link_libraries(${extension} PRIVATE ${PDAL_LIBRARIES})
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ USE-CASE : Take a LiDAR map, create a mesh from the ground points, split into ti
Requirements
================================================================================

* PDAL 2.5+
* PDAL 2.6+
* Python >=3.9
* Pybind11 (eg :code:`pip install pybind11[global]`)
* Numpy (eg :code:`pip install numpy`)
* scikit-build (eg :code:`pip install scikit-build`)
* scikit-build-core (eg :code:`pip install scikit-build-core`)
69 changes: 68 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,69 @@
[project]
name = "pdal"
description = "Point cloud data processing"
readme = "README.rst"
requires-python = ">=3.9"
license = {file = "LICENSE.txt"}
keywords = ["point", "cloud", "spatial"]
authors = [
{email = "[email protected]"},
{name = "Howard Butler"}
]
maintainers = [
{name = "Howard Butler", email = "[email protected]"}
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: GIS",
]

dependencies = [
"numpy"
]

#dynamic = ["version"]

#[tool.scikit-build.dynamic]
#version = { attr = "pdal.__version__" }
version="3.4.0"

[project.optional-dependencies]
test = [
"pandas",
"meshio"
]

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

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

[build-system]
requires = ["scikit-build", "cmake>=3.11", "ninja", "numpy", "pybind11[global]"]
requires = ["scikit-build-core", "numpy", "pybind11[global]"]
build-backend = "scikit_build_core.build"


[tool.scikit-build]
build-dir = "build/{wheel_tag}"
sdist.exclude = [".github"]
sdist.cmake = true
cmake.build-type = "RelWithDebugInfo"
sdist.include = [
"src",
"CMakeLists.txt"
]
cmake.verbose = false
logging.level = "ERROR"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pdal/__init__.py → src/pdal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.3.0"
__version__ = "3.4.0"
__all__ = ["Pipeline", "Stage", "Reader", "Filter", "Writer", "dimensions", "info"]

from . import libpdalpython
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 34c9988

Please sign in to comment.