File tree Expand file tree Collapse file tree
pycode/memilio-simulation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 - published
77 # ## Uncomment the "push:" together with the "repository-url:" field of action pypa/gh-action-pypi-publish
88 # ## to make a test release. Building this is rather expensive so do not merge this uncommented!
9- # push:
9+ push :
1010 # ## @Reviewer: MAKE SURE THE LINE ABOVE IS COMMENTED OUT BEFORE MERGE! ###
1111
1212jobs :
7373 with :
7474 skip-existing : true
7575 # ## To test uploads to TestPyPI in a PR, uncomment the following, as well as the "push:" line at the top:
76- # repository-url: https://test.pypi.org/legacy/
76+ repository-url : https://test.pypi.org/legacy/
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.14 )
22project (memilio-python)
33
4+ # copy cpp files for building sdist's, then exit immediately
5+ # Note: ${SKBUILD_STATE} is "wheel" while building from an sdist
6+ if (SKBUILD_STATE STREQUAL "sdist" )
7+ message (STATUS "Copying current C++ source tree for distribution" )
8+ file (COPY ${CMAKE_CURRENT_SOURCE_DIR } /../../cpp DESTINATION ${CMAKE_CURRENT_SOURCE_DIR }
9+ PATTERN "build" EXCLUDE
10+ PATTERN ".cache" EXCLUDE )
11+ return ()
12+ endif ()
13+
414set (CMAKE_CXX_STANDARD "20" )
515set (CMAKE_CXX_STANDARD_REQUIRED "20" )
616
@@ -55,7 +65,14 @@ else()
5565endif ()
5666
5767# add in C++ library
58- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR } /../../cpp ${CMAKE_CURRENT_BINARY_DIR } /cpp EXCLUDE_FROM_ALL )
68+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /cpp)
69+ # this is a sdist build, hence we use a copy C++ source tree, so that it is not out-of-tree wrt. pyproject.toml
70+ message (WARNING "Using ${CMAKE_CURRENT_SOURCE_DIR } /cpp as C++ source tree. This is intentional for sdist builds." )
71+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR } /cpp ${CMAKE_CURRENT_BINARY_DIR } /cpp EXCLUDE_FROM_ALL )
72+ else ()
73+ # normal include using the main project tree
74+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR } ../../cpp ${CMAKE_CURRENT_BINARY_DIR } /cpp EXCLUDE_FROM_ALL )
75+ endif ()
5976
6077# a list of all "LINKED_LIBRARIES" that are given to add_pymio_module. will contain duplicates
6178# used for wheel installation
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ build-backend = "scikit_build_core.build"
99
1010[project ]
1111name = " memilio-simulation"
12- dynamic = [" version" ]
12+ dynamic = [" version" ]
1313description = " Part of MEmilio project, Python bindings to the C++ libraries that contain the models and simulations."
1414readme = " README.md"
1515requires-python = " >=3.8"
16- license = " Apache-2.0"
16+ license = " Apache-2.0"
1717authors = [{ name = " MEmilio Team" }]
1818maintainers = [
1919 { email = " martin.kuehn@dlr.de" }
@@ -56,10 +56,12 @@ cmake.version = ">=3.13"
5656cmake.args = [" -DMEMILIO_BUILD_SHARED_LIBS:BOOL=ON" ]
5757wheel.packages = [" memilio" ]
5858wheel.install-dir = " memilio/simulation"
59+ sdist.cmake = true
60+ sdist.exclude = [" dist" ]
5961build-dir = " ../build/memilio-simulation"
6062metadata.version.provider = " scikit_build_core.metadata.setuptools_scm"
6163
62- [tool .setuptools_scm ]
64+ [tool .setuptools_scm ]
6365local_scheme = " no-local-version"
6466# point scm to the git project root
6567root = " ../.."
You can’t perform that action at this time.
0 commit comments