From f504027d1ffd1c8845e8f23e9c273e7805a289f4 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 2 Oct 2023 15:07:49 +0100 Subject: [PATCH 1/4] Add python 3.12 to regular CI + wheel production matrix --- .github/workflows/Draft-Release.yml | 6 ++++-- .github/workflows/Manylinux2014.yml | 2 +- .github/workflows/Ubuntu.yml | 2 +- .github/workflows/Windows.yml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Draft-Release.yml b/.github/workflows/Draft-Release.yml index 7532db674..96e92b628 100644 --- a/.github/workflows/Draft-Release.yml +++ b/.github/workflows/Draft-Release.yml @@ -26,9 +26,9 @@ defaults: # + Thorough Windows builds # + Oldest and newest cuda, lots of arch, vis off, tests on # + Wheel producing manylinux builds -# + CUDA 11.2 and 12.0, py 3.7-11, vis on/off, py only. +# + CUDA 11.2 and 12.0, py 3.7-3.12, vis on/off, py only. # + Wheel producing Windows builds -# + CUDA 11.2 and 12.0, py 3.7-11, vis on/off, py only. +# + CUDA 11.2 and 12.0, py 3.7-3.12, vis on/off, py only. # + Draft github release workflow. jobs: @@ -319,6 +319,7 @@ jobs: hostcxx: devtoolset-9 os: ubuntu-20.04 python: + - "3.12" - "3.11" - "3.10" - "3.9" @@ -479,6 +480,7 @@ jobs: hostcxx: "Visual Studio 16 2019" os: windows-2019 python: + - "3.12" - "3.11" - "3.10" - "3.9" diff --git a/.github/workflows/Manylinux2014.yml b/.github/workflows/Manylinux2014.yml index 0e4a4bcaf..59a7d3b51 100644 --- a/.github/workflows/Manylinux2014.yml +++ b/.github/workflows/Manylinux2014.yml @@ -42,7 +42,7 @@ jobs: hostcxx: devtoolset-9 os: ubuntu-20.04 python: - - "3.11" + - "3.12" config: - name: "Release" config: "Release" diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml index f5fe1e712..42cd51ae0 100644 --- a/.github/workflows/Ubuntu.yml +++ b/.github/workflows/Ubuntu.yml @@ -42,7 +42,7 @@ jobs: hostcxx: gcc-8 os: ubuntu-20.04 python: - - "3.11" + - "3.12" config: - name: "Release" config: "Release" diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index c0e1d3cca..7ff24c93a 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -42,7 +42,7 @@ jobs: hostcxx: "Visual Studio 16 2019" os: windows-2019 python: - - "3.11" + - "3.12" config: - name: "Release" config: "Release" From 1e225a464224494cd3ebca9a655547d4450c48e3 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Mon, 2 Oct 2023 15:09:58 +0100 Subject: [PATCH 2/4] Remove Python 3.7 wheel generation from CI as EOL 2023-06-27 Does not remove workarounds in code for python <= 3.7, so it will still techniaclly be usable just not supported --- .github/workflows/Draft-Release.yml | 6 ++---- README.md | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Draft-Release.yml b/.github/workflows/Draft-Release.yml index 96e92b628..984d609c5 100644 --- a/.github/workflows/Draft-Release.yml +++ b/.github/workflows/Draft-Release.yml @@ -26,9 +26,9 @@ defaults: # + Thorough Windows builds # + Oldest and newest cuda, lots of arch, vis off, tests on # + Wheel producing manylinux builds -# + CUDA 11.2 and 12.0, py 3.7-3.12, vis on/off, py only. +# + CUDA 11.2 and 12.0, py 3.8-3.12, vis on/off, py only. # + Wheel producing Windows builds -# + CUDA 11.2 and 12.0, py 3.7-3.12, vis on/off, py only. +# + CUDA 11.2 and 12.0, py 3.8-3.12, vis on/off, py only. # + Draft github release workflow. jobs: @@ -324,7 +324,6 @@ jobs: - "3.10" - "3.9" - "3.8" - - "3.7" config: - name: "Release" config: "Release" @@ -485,7 +484,6 @@ jobs: - "3.10" - "3.9" - "3.8" - - "3.7" config: - name: "Release" config: "Release" diff --git a/README.md b/README.md index d65513135..323e855f3 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Optionally: + [cpplint](https://github.com/cpplint/cpplint) for linting code + [Doxygen](http://www.doxygen.nl/) to build the documentation -+ [Python](https://www.python.org/) `>= 3.7` for python integration ++ [Python](https://www.python.org/) `>= 3.8` for python integration + With `setuptools`, `wheel`, `build` and optionally `venv` python packages installed + [swig](http://www.swig.org/) `>= 4.0.2` for python integration + Swig `4.x` will be automatically downloaded by CMake if not provided (if possible). From a829b73084557f87c3f58faa930d4060d68c0ed7 Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 5 Oct 2023 17:20:10 +0100 Subject: [PATCH 3/4] Guard python 3.12 deprecated methods to only be used by python < 3.8.0 --- swig/python/codegen/codegen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swig/python/codegen/codegen.py b/swig/python/codegen/codegen.py index 264c36314..590a099b2 100644 --- a/swig/python/codegen/codegen.py +++ b/swig/python/codegen/codegen.py @@ -223,7 +223,7 @@ def dispatchMacroEnvFunction(self, tree, tree_parent): bounds = tree_parent.args[1:] # process bounds by appending to cpp function template arguments for i in bounds: - if isinstance(i, ast.Num): # num required for python 3.7 + if sys.version_info < (3,8,0) and isinstance(i, ast.Num): # num required for python 3.7 if not isinstance(i.n, int): self.RaiseError(tree, f" Macro environment function argument '{i}' should be an integer value.") cpp_func_name += f", {i.n}" @@ -585,7 +585,7 @@ def _Expr(self, tree): if isinstance(tree.value.value, str): return # catch special case of Python 3.7 Where doc string is a Str and not a Constant - elif isinstance(tree.value, ast.Str): + elif sys.version_info < (3,8,0) and isinstance(tree.value, ast.Str): return # otherwise treat like a normal expression self.fill() From 5524f7848dfc8de2ea1de82315c8603d8fdd34d9 Mon Sep 17 00:00:00 2001 From: mondus Date: Fri, 6 Oct 2023 12:45:55 +0100 Subject: [PATCH 4/4] Update swig/python/codegen/codegen.py --- swig/python/codegen/codegen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swig/python/codegen/codegen.py b/swig/python/codegen/codegen.py index 590a099b2..60b856f82 100644 --- a/swig/python/codegen/codegen.py +++ b/swig/python/codegen/codegen.py @@ -585,7 +585,7 @@ def _Expr(self, tree): if isinstance(tree.value.value, str): return # catch special case of Python 3.7 Where doc string is a Str and not a Constant - elif sys.version_info < (3,8,0) and isinstance(tree.value, ast.Str): + elif sys.version_info < (3,8,0) and isinstance(tree.value, ast.Str): # num required for python 3.7 return # otherwise treat like a normal expression self.fill()