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

editable build #3

Merged
merged 2 commits into from
Nov 28, 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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.15...3.26)

# https://scikit-build-core.readthedocs.io/en/latest/cmakelists.html#accessing-information
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
Expand All @@ -25,6 +26,8 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()

# TODO, use set(PYBIND11_NEWPYTHON ON)?
# https://scikit-build-core.readthedocs.io/en/latest/getting_started.html
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
PROJECT_SOURCE_DIR ?= $(abspath ./)
PROJECT_NAME ?= $(shell basename $(PROJECT_SOURCE_DIR))
BUILD_DIR ?= $(PROJECT_SOURCE_DIR)/build
INSTALL_DIR ?= $(BUILD_DIR)/install
NUM_JOB ?= 8

all:
@echo nothing special
Expand Down Expand Up @@ -51,14 +49,19 @@ test_in_dev_container:
--network host --security-opt seccomp=unconfined \
-v `pwd`:`pwd` -w `pwd` -it $(DEV_CONTAINER_IMAG) bash


PYTHON ?= python3
build:
# CMAKE_BUILD_PARALLEL_LEVEL=8
$(PYTHON) -m pip install --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=build -ve.
python_install:
$(PYTHON) -m pip install . --verbose
python_build:
python_wheel:
$(PYTHON) -m pip wheel . --verbose
python_sdist:
$(PYTHON) -m pip sdist .
$(PYTHON) -m pip sdist . --verbose
python_test: pytest
.PHONY: build

# conda create -y -n py36 python=3.6
# conda create -y -n py37 python=3.7
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ dependencies = [
test = ["pytest"]


# docs: https://scikit-build-core.readthedocs.io/en/latest/configuration.html
[tool.scikit-build]
wheel.expand-macos-universal-tags = true
# cmake.build-type = "Debug"
# build-dir = "build/{wheel_tag}"

[tool.scikit-build.cmake.define]
# SOME_DEFINE = "ON"


[tool.pytest.ini_options]
Expand Down
Loading