Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use scikit-build-core and CMake for build #6

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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