diff --git a/.gitignore b/.gitignore index 47d9567..ce4262e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *~ build -_build dist *.pyc *.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c056b..58656fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register") # Set up gtest. This must be set up before any subdirectories are # added which will use gtest. # TODO: clean this up a bit, maybe make this optional? -add_subdirectory(src/ext/googletest) include_directories(${GTEST_INCLUDE_DIRS}) link_directories(${GTEST_LIBS_DIR}) add_definitions("-fPIC") @@ -36,19 +35,24 @@ include_directories("${PROJECT_BINARY_DIR}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -# This controls whether or not to build the python bridge -if(BUILD_PYTHON) - add_subdirectory(src/lib/python) -endif() # add the actual code include_directories(src/lib) add_subdirectory(src/lib) -add_subdirectory(src/programs) - -# Add make install functionality -#install(TARGETS peval) -#install(TARGETS penum) -#install(TARGETS ps-colex) -#install(TARGETS ps-eval) -#install(TARGETS ps-lut) + +# This controls whether or not we are building the python +# binaries, and possibly the wheel file. +# TODO: add a separate option for building the wheel vs. python +if(BUILD_PYTHON) + add_subdirectory(src/lib/python) +else() + # none of these are needed in the wheel file + add_subdirectory(src/programs) + add_subdirectory(src/ext/googletest) + # Add make install functionality + install(TARGETS peval) + install(TARGETS penum) + install(TARGETS ps-colex) + install(TARGETS ps-eval) + install(TARGETS ps-lut) +endif() diff --git a/README.md b/README.md index 9d94f5d..480de28 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,9 @@ shell: ## Python wheel package +You will need to install pipx to build with scikit-build-core, using +apt on Ubuntu and brew on MacOS. + There is also a `pyproject.toml` file which can be used to create an installable wheel for the pythong package. The commands below can be used to build/install/verify the package. @@ -178,7 +181,7 @@ used to build/install/verify the package. pipx run build python3 -m venv venv . venv/bin/activate - pip install dist/pokerstove-1.2-cp310-cp310-linux_x86_64.whl + pip install dist/pokerstove-*.whl python src/lib/python/test-python deactivate diff --git a/pyproject.toml b/pyproject.toml index 5d87beb..a7c63bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ cmake.version = ">=3.5" cmake.build-type = "Release" build.targets = ["pokerstove"] install.components = ["pokerstove"] +sdist.exclude = ["src/programs", "android", "win32", "src/ext", "doc", ".*"] # build.verbose = true # logging.level = "DEBUG"