Skip to content

Commit

Permalink
Merge pull request #6 from nqminds/refactor/use-scikit-build-core-bui…
Browse files Browse the repository at this point in the history
…ld-backend

build: use `scikit-build-core` and CMake for build
  • Loading branch information
aloisklink authored Jul 24, 2023
2 parents 8fc6325 + 979a3ee commit 88834c9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.15...3.26)

# parse just the main numeric part of a PEP 440 version
string(REGEX MATCH
[=[
[0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9]+)?)?)?
]=]
skbuild_project_numeric_version
"${SKBUILD_PROJECT_VERSION}"
)

project(
${SKBUILD_PROJECT_NAME}
VERSION "${skbuild_project_numeric_version}"
LANGUAGES CXX)

find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

python_add_library(irimager MODULE src/nqm/irimager/irimager.cpp WITH_SOABI)
target_link_libraries(irimager PRIVATE pybind11::headers)
target_compile_definitions(irimager PRIVATE VERSION_INFO=${PROJECT_VERSION})

install(TARGETS irimager DESTINATION "nqm")
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Python module for interfacing with [EvoCortex IRImagerDirect SDK][1].
## Setup

This repo uses [PEP621](https://peps.python.org/pep-0621/) to manage
dependencies.
dependencies. [scikit-build-core](https://pypi.org/project/scikit-build-core/)
is used to compile the project as a `build-system.build-backend`.

We recommend using [PDM](https://pdm.fming.dev/latest/) for local development.

Expand Down
23 changes: 0 additions & 23 deletions build.py

This file was deleted.

9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ dependencies = [
]

[build-system]
requires = ["pdm-backend>=2.1.4", "pybind11>=2.10.4"]
build-backend = "pdm.backend"
requires = ["scikit-build-core>=0.4.7", "pybind11>=2.10.4"]
build-backend = "scikit_build_core.build"

[tool.pdm.build]
run-setuptools = true
custom-hook = "build.py"
[tool.scikit-build]
wheel.packages = [ "src/nqm" ]

[tool.pylint.main]
# checks Google-style docstrings
Expand Down

0 comments on commit 88834c9

Please sign in to comment.