From 1b91f22a75ad3a485bdf74ebfc257e6c8d6caab1 Mon Sep 17 00:00:00 2001 From: Christoph Lehmann Date: Tue, 14 May 2024 10:29:50 +0200 Subject: [PATCH 1/4] [scr] Removed upper limit on Python version --- scripts/cmake/PythonSetup.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake index ac16984cf94..ebe9ba4bca2 100644 --- a/scripts/cmake/PythonSetup.cmake +++ b/scripts/cmake/PythonSetup.cmake @@ -1,11 +1,5 @@ # cmake-lint: disable=C0103 -set(_python_version_max "...<3.12") -if(WIN32 AND NOT OGS_BUILD_WHEEL) - # 3.11 crashes at initialization on Windows. - set(_python_version_max "...<3.11") -endif() - if(OGS_USE_PIP) set(LOCAL_VIRTUALENV_DIR ${PROJECT_BINARY_DIR}/.venv CACHE INTERNAL "") set(Python_ROOT_DIR ${LOCAL_VIRTUALENV_DIR}) @@ -14,7 +8,7 @@ if(OGS_USE_PIP) execute_process( COMMAND ${CMAKE_COMMAND} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} - -Dpython_version=${ogs.minimum_version.python}${_python_version_max} + -Dpython_version=${ogs.minimum_version.python} -P ${PROJECT_SOURCE_DIR}/scripts/cmake/PythonCreateVirtualEnv.cmake WORKING_DIRECTORY ${PROJECT_BINARY_DIR} COMMAND_ECHO STDOUT @@ -71,7 +65,7 @@ if(NOT OGS_BUILD_WHEEL) endif() find_package( - Python ${ogs.minimum_version.python}${_python_version_max} + Python ${ogs.minimum_version.python} COMPONENTS ${_python_componets} REQUIRED ) From 8d158acc3eb282d1c87144aac7b5d32349f4d53b Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 14 May 2024 13:18:52 +0200 Subject: [PATCH 2/4] [py] Update snakemake and fix ctests on Python 3.12. Used oldest Snakemake 8 version which works. --- scripts/cmake/PythonSetup.cmake | 1 + scripts/snakemake/modules/meshes.smk | 2 +- web/data/versions.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake index ebe9ba4bca2..1c6f02f0abd 100644 --- a/scripts/cmake/PythonSetup.cmake +++ b/scripts/cmake/PythonSetup.cmake @@ -96,6 +96,7 @@ if(OGS_USE_PIP) list(APPEND OGS_PYTHON_PACKAGES "snakemake==${ogs.minimum_version.snakemake}" "pulp==2.7.0" # https://github.com/snakemake/snakemake/issues/2607 + "setuptools" # https://github.com/glenfant/stopit/issues/32 ) set(SNAKEMAKE ${LOCAL_VIRTUALENV_BIN_DIR}/snakemake CACHE FILEPATH "" FORCE diff --git a/scripts/snakemake/modules/meshes.smk b/scripts/snakemake/modules/meshes.smk index 5bd643a268c..4d24e8e02cc 100644 --- a/scripts/snakemake/modules/meshes.smk +++ b/scripts/snakemake/modules/meshes.smk @@ -1,6 +1,6 @@ rule generate_square_mesh: output: - "{mesh_name_prefix,\w+}_{size,\d+}_{lx,\d+}x{ly,\d+}_{type}.vtu" + "{mesh_name_prefix,\\w+}_{size,\\d+}_{lx,\\d+}x{ly,\\d+}_{type}.vtu" shell: """ generateStructuredMesh -e {wildcards.type} \ diff --git a/web/data/versions.json b/web/data/versions.json index 4e19cd3ae67..8642d1b02c0 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -19,7 +19,7 @@ "petsc": "3.18.6", "qt": "5.14.2", "python": "3.6", - "snakemake": "7.32.4", + "snakemake": "8.2.4", "hdf5": "1.10.7", "libxml2": "2.9.12", "tfel-rliv": "4.0", From 1049aada221ae43a6c558de7b009d0067e0324ca Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 14 May 2024 13:21:00 +0200 Subject: [PATCH 3/4] [py] Bump min. version to 3.9 (in line with ogstools). --- web/data/versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/data/versions.json b/web/data/versions.json index 8642d1b02c0..1872df25e07 100644 --- a/web/data/versions.json +++ b/web/data/versions.json @@ -18,7 +18,7 @@ "vtk": "9.3.0", "petsc": "3.18.6", "qt": "5.14.2", - "python": "3.6", + "python": "3.9", "snakemake": "8.2.4", "hdf5": "1.10.7", "libxml2": "2.9.12", From ac5097fb9651a81ba0d2cb3b9b822d95ceaba28c Mon Sep 17 00:00:00 2001 From: Lars Bilke Date: Tue, 14 May 2024 13:22:33 +0200 Subject: [PATCH 4/4] [py] Update pyproject.toml, build wheels for Python 3.9 - 3.12. --- pyproject.toml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 280586d883c..22c897a893e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "OpenGeoSys Python wheel" readme = "README.md" license = { file = "LICENSE.txt" } authors = [{ email = "info@opengeosys.org" }, { name = "OpenGeoSys Community" }] -requires-python = ">=3.8" +requires-python = ">=3.9" [project.urls] homepage = "https://opengeosys.org" @@ -52,11 +52,8 @@ norecursedirs = ["Tests/Data"] [tool.cibuildwheel] archs = "auto64" -build = ["cp3{8,9,10,11}-*"] -skip = [ - "*musllinux*", - "cp38-macosx_x86_64", -] # otherwise error: 'is not a supported wheel on this platform'archs = "auto64" +build = ["cp3{9,10,11,12}-*"] +skip = ["*musllinux*"] test-extras = "test" test-command = "pytest {project}/Tests/Python" build-verbosity = "1"