-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build to use scikit-build-core (#165)
* modernize with scikit-build-core * update metata * CI churn * add convenience for printing info about the library and getting the pdal-plugin-path * Release build type * Test --no-deps --no-build-isolation * release stuff * add note about needing PDAL base library to PyPI README * dynamic version, pin scikit-build-core > 0.9 * remove cruft
- Loading branch information
Showing
19 changed files
with
208 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/pdal-plugins | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
strategy: | ||
fail-fast: true | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup micromamba | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
use-mamba: true | ||
python-version: ${{ matrix.python-version }} | ||
auto-update-conda: true | ||
environment-file: .github/environment.yml | ||
|
||
- name: Install dependencies | ||
shell: bash -l {0} | ||
run: | | ||
python -m pip install build pipx twine | ||
pipx run 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "howard@hobu.co"}, | ||
{name = "Howard Butler"} | ||
] | ||
maintainers = [ | ||
{name = "Howard Butler", email = "howard@hobu.co"} | ||
] | ||
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.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering :: GIS", | ||
] | ||
|
||
dependencies = [ | ||
"numpy" | ||
] | ||
|
||
dynamic = ["version"] | ||
|
||
[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 >= 0.9", "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 = "Release" | ||
sdist.include = [ | ||
"src", | ||
"CMakeLists.txt" | ||
] | ||
cmake.verbose = false | ||
logging.level = "ERROR" | ||
|
||
[tool.scikit-build.metadata.version] | ||
provider = "scikit_build_core.metadata.regex" | ||
input = "src/pdal/__init__.py" |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import sys | ||
import os | ||
import pathlib | ||
|
||
import distutils.ccompiler | ||
so_ext = distutils.ccompiler.new_compiler().shared_lib_extension | ||
import sysconfig | ||
|
||
import argparse | ||
|
||
import pdal | ||
|
||
from . import __version__ | ||
|
||
__all__ = ["main"] | ||
|
||
|
||
def __dir__() -> list[str]: | ||
return __all__ | ||
|
||
|
||
def print_driver_path(args): | ||
print (os.environ['PDAL_DRIVER_PATH']) | ||
|
||
def print_plugin_path(args): | ||
purelib = sysconfig.get_paths()["purelib"]+os.path.sep+"pdal" | ||
|
||
if sys.platform == "linux" or sys.platform == "linux2": | ||
suffix = 'so' | ||
purelib = purelib + os.path.sep + "pdal" | ||
elif sys.platform == "darwin": | ||
suffix = 'dylib' | ||
purelib = purelib + os.path.sep + "pdal" | ||
elif sys.platform == "win32": | ||
suffix = 'dll' | ||
purelib = purelib + os.path.sep + "bin" | ||
|
||
for f in pathlib.Path(purelib).glob(f'*.{suffix}'): | ||
if 'pdal' in str(f.name): | ||
if 'numpy' in str(f.name) or 'python' in str(f.name): | ||
print (purelib) | ||
return # we are done | ||
|
||
def print_version(args): | ||
info = pdal.drivers.libpdalpython.getInfo() | ||
pdal_version = info.version | ||
plugin = info.plugin | ||
debug = info.debug | ||
|
||
line = '----------------------------------------------------------------------------------------------------------------------------\n' | ||
version = f'PDAL version {pdal_version}\nPython bindings version {__version__}\n' | ||
plugin = f"Environment-set PDAL_DRIVER_PATH: {os.environ['PDAL_DRIVER_PATH']}" | ||
output = f'{line}{version}{plugin}\n{line}\n{debug}' | ||
print (output) | ||
|
||
|
||
def main() -> None: | ||
header = f"PDAL Python bindings {__version__} on Python {sys.version}" | ||
|
||
parser = argparse.ArgumentParser(description=header) | ||
parser.add_argument('--pdal-driver-path', action='store_true', | ||
help='print PDAL_DRIVER_PATH including Python plugin locations') | ||
parser.add_argument('--pdal-plugin-path', action='store_true', | ||
help='print location of PDAL Python plugins') | ||
|
||
args = parser.parse_args() | ||
|
||
if args.pdal_driver_path: | ||
print_driver_path(args) | ||
elif args.pdal_plugin_path: | ||
print_plugin_path(args) | ||
else: | ||
print_version(args) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
File renamed without changes.
File renamed without changes.