From 06ed2ac9fc677f9d295486a02f54d148d749d005 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Tue, 3 Aug 2021 09:31:07 +0200 Subject: [PATCH] [poetry] Fix install command on Windows. --- CMakeLists.txt | 6 +----- scripts/ci/jobs/build-linux.yml | 3 ++- scripts/cmake/PythonSetup.cmake | 7 +++++++ scripts/python/pyproject.in.toml | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 746f6fb43ad..0823bb4773d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,12 +225,8 @@ include(UnityBuildSettings) if(POETRY) file(STRINGS ${PROJECT_BINARY_DIR}/.python_packages OGS_PYTHON_PACKAGES) list(REMOVE_DUPLICATES OGS_PYTHON_PACKAGES) - # Hack for tespy requirement - if(${Python3_VERSION} VERSION_LESS 3.10) - set(_python_arg --python <3.9) - endif() execute_process( - COMMAND ${_CMD_COMMAND} poetry add ${_python_arg} ${OGS_PYTHON_PACKAGES} + COMMAND ${_CMD_COMMAND} poetry add ${OGS_PYTHON_PACKAGES} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) endif() diff --git a/scripts/ci/jobs/build-linux.yml b/scripts/ci/jobs/build-linux.yml index 7d362872127..24ebb7be38d 100644 --- a/scripts/ci/jobs/build-linux.yml +++ b/scripts/ci/jobs/build-linux.yml @@ -27,7 +27,8 @@ linux ctest large: allow_failure: true timeout: 2h variables: - TARGETS: ctest-large + BUILD_TESTS: "false" + BUILD_CTEST_LARGE: "true" CMAKE_PRESET: release-all CMAKE_ARGS: >- -DOGS_USE_PYTHON=ON diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake index 73c66c856f9..8b2b26b567e 100644 --- a/scripts/cmake/PythonSetup.cmake +++ b/scripts/cmake/PythonSetup.cmake @@ -1,7 +1,14 @@ # cmake-lint: disable=C0103 + +# prefer unix location over frameworks (Apple-only) +set(Python3_FIND_FRAMEWORK LAST) if(OGS_USE_POETRY) find_program(POETRY poetry) if(POETRY) + find_package( + Python3 ${ogs.minimum_version.python} COMPONENTS Interpreter + REQUIRED + ) configure_file( ${PROJECT_SOURCE_DIR}/scripts/python/poetry.in.toml ${PROJECT_BINARY_DIR}/poetry.toml COPYONLY diff --git a/scripts/python/pyproject.in.toml b/scripts/python/pyproject.in.toml index 0adfb1eeb9b..f1e79914dd2 100644 --- a/scripts/python/pyproject.in.toml +++ b/scripts/python/pyproject.in.toml @@ -1,11 +1,11 @@ [tool.poetry] name = "ogs-build" -version = "@OGS_VERSION@" # is written just once, maybe outdated +version = "@OGS_VERSION@" # is written just once, maybe outdated description = "CMake auto-generated" authors = [""] [tool.poetry.dependencies] -python = ">=@ogs.minimum_version.python@" +python = "@Python3_VERSION@" [tool.poetry.dev-dependencies] -- GitLab