diff --git a/pyproject.toml b/pyproject.toml
index 768f363e6815ac910f62d95b8748f7e1308c377d..acb60b62466dac36d0da754637d5e0f7844b0532 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -15,7 +15,7 @@ norecursedirs = ["Tests/Data"]
 [tool.cibuildwheel]
 archs = "auto64"
 build = "cp3*"
-skip = "*musllinux*"
+skip = ["*musllinux*"]
 test-extras = "test"
 test-command = "pytest {project}/Tests/Python"
 # test-command = ""
diff --git a/scripts/cmake/PythonSetup.cmake b/scripts/cmake/PythonSetup.cmake
index 14ac317021d3c90296e3f73b68eaf4dbd1249b10..ef6be751483de6a3bb6e6784b3888f0a98e3cccf 100644
--- a/scripts/cmake/PythonSetup.cmake
+++ b/scripts/cmake/PythonSetup.cmake
@@ -1,6 +1,9 @@
 # cmake-lint: disable=C0103
 
-set(_python_version_max "...<3.11")
+if(OGS_USE_PYTHON)
+    set(_python_version_max "...<3.11")
+endif()
+
 if(OGS_USE_PIP)
     set(Python_ROOT_DIR ${PROJECT_BINARY_DIR}/.venv)
     set(CMAKE_REQUIRE_FIND_PACKAGE_Python TRUE)