Skip to content

Commit

Permalink
improve wheel packaging build
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprock-anari committed Sep 28, 2024
1 parent 1f38a98 commit d5c274c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ installable wheel for the pythong package. The commands below can be
used to build/install/verify the package.

pipx run build
python3 -m venv venv
. venv/bin/activate
python3 -m venv venv && . venv/bin/activate
pip install dist/pokerstove-*.whl
python src/lib/python/test-python
deactivate
Expand Down
12 changes: 4 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ name = "pokerstove"
version = "1.2"

[tool.scikit-build]
build-dir = "_build"
wheel.packages = ["_build/python/pokerstove"]
cmake.version = ">=3.5"
cmake.build-type = "Release"
build-dir = "_build/{wheel_tag}"
wheel.packages = []
cmake.version = ">=3.15"
build.targets = ["pokerstove"]
install.components = ["pokerstove"]
install.components = ["python"]
sdist.exclude = ["src/programs", "android", "win32", "src/ext", "doc", ".*"]
# build.verbose = true
# logging.level = "DEBUG"

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

6 changes: 5 additions & 1 deletion src/lib/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.18)

# find swig and python and configure them
set(CMAKE_SWIG_FLAGS)
set(UseSWIG_MODULE_VERSION 2)
find_package(SWIG REQUIRED)
include(UseSWIG)

Expand All @@ -26,10 +27,13 @@ set_property(SOURCE pokerstove.i PROPERTY SWIG_MODULE_NAME ${PS_TARGET})
swig_add_library(${PS_TARGET}
TYPE MODULE
LANGUAGE python
OUTPUT_DIR ${PYTHON_PROJECT_DIR}
SOURCES pokerstove.i)
add_library(${PROJECT_NAMESPACE}::${PS_TARGET} ALIAS ${PS_TARGET})

install(TARGETS ${PS_TARGET} DESTINATION . COMPONENT python)
get_property(_support_files TARGET ${PS_TARGET} PROPERTY SWIG_SUPPORT_FILES)
install(FILES "${_support_files}" DESTINATION . COMPONENT python)

# note: macOS is APPLE and also UNIX !
if(APPLE)
set_property(TARGET ${PS_TARGET} APPEND PROPERTY
Expand Down

0 comments on commit d5c274c

Please sign in to comment.