From e8791cca6a6990dd801e6ee8b8b62c851a671b8e Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Thu, 19 Oct 2023 08:20:17 +0000 Subject: [PATCH 1/6] add support for Python 3.12 wheel --- .pfnci/build_submit.sh | 2 +- .pfnci/config.pbtxt | 2 +- .pfnci/wheel-windows/_flexci.ps1 | 2 ++ dist_config.py | 5 +++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.pfnci/build_submit.sh b/.pfnci/build_submit.sh index ae59ed8d..aec17e7c 100755 --- a/.pfnci/build_submit.sh +++ b/.pfnci/build_submit.sh @@ -30,7 +30,7 @@ submit_job() { # wheels (Windows) for CUDA in 11.x 12.x; do - for PYTHON in 3.9 3.10 3.11; do + for PYTHON in 3.9 3.10 3.11 3.12; do submit_job cupy-wheel-win ".pfnci\\wheel-windows\\main.bat ${CUDA} ${PYTHON} ${BRANCH} ${JOB_GROUP}" done done diff --git a/.pfnci/config.pbtxt b/.pfnci/config.pbtxt index 104beeb6..b49f9c49 100644 --- a/.pfnci/config.pbtxt +++ b/.pfnci/config.pbtxt @@ -56,7 +56,7 @@ configs { time_limit { seconds: 10800 } - command: ".pfnci\\wheel-windows\\main.bat 12.x 3.11" + command: ".pfnci\\wheel-windows\\main.bat 12.x 3.12" } } configs { diff --git a/.pfnci/wheel-windows/_flexci.ps1 b/.pfnci/wheel-windows/_flexci.ps1 index c395f835..15556384 100644 --- a/.pfnci/wheel-windows/_flexci.ps1 +++ b/.pfnci/wheel-windows/_flexci.ps1 @@ -13,6 +13,8 @@ function ActivatePython($version) { $pydir = "Python310" } elseif ($version -eq "3.11") { $pydir = "Python311" + } elseif ($version -eq "3.12") { + $pydir = "Python312" } else { throw "Unsupported Python version: $version" } diff --git a/dist_config.py b/dist_config.py index 30918bc3..1b98a5dc 100644 --- a/dist_config.py +++ b/dist_config.py @@ -249,4 +249,9 @@ 'python_tag': 'cp311', 'abi_tag': 'cp311', }, + '3.12': { + 'pyenv': '3.12.0', + 'python_tag': 'cp312', + 'abi_tag': 'cp312', + }, } From 2409cbb612301335816c7cb717c24f12f9433b81 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Thu, 19 Oct 2023 08:26:46 +0000 Subject: [PATCH 2/6] update checker script --- check_release_assets.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/check_release_assets.py b/check_release_assets.py index 468cc39b..5a522963 100755 --- a/check_release_assets.py +++ b/check_release_assets.py @@ -15,6 +15,7 @@ CP39 = 'cp39-cp39' CP310 = 'cp310-cp310' CP311 = 'cp311-cp311' +CP312 = 'cp312-cp312' LINUX = 'manylinux2014_x86_64' LINUX_V11 = 'manylinux1_x86_64' LINUX_AARCH64 = 'manylinux2014_aarch64' @@ -24,18 +25,18 @@ sdist_project = 'cupy' _v13_cuda_matrix = list(itertools.product( - (CP39, CP310, CP311), (LINUX, WINDOWS))) + (CP39, CP310, CP311, CP312), (LINUX, WINDOWS))) _v13_aarch64_matrix = list(itertools.product( - (CP39, CP310, CP311), (LINUX_AARCH64,))) + (CP39, CP310, CP311, CP312), (LINUX_AARCH64,))) _v13_rocm_matrix = list(itertools.product( - (CP39, CP310, CP311), (LINUX,))) + (CP39, CP310, CP311, CP312), (LINUX,))) _v12_cuda_matrix = list(itertools.product( - (CP38, CP39, CP310, CP311), (LINUX, WINDOWS))) + (CP38, CP39, CP310, CP311, CP312), (LINUX, WINDOWS))) _v12_aarch64_matrix = list(itertools.product( - (CP38, CP39, CP310, CP311), (LINUX_AARCH64,))) + (CP38, CP39, CP310, CP311, CP312), (LINUX_AARCH64,))) _v12_rocm_matrix = list(itertools.product( - (CP38, CP39, CP310, CP311), (LINUX,))) + (CP38, CP39, CP310, CP311, CP312), (LINUX,))) pypi_wheel_projects = { # v12.x From 686cd78be1361c5118b6296b9559ff4c4daeead2 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Thu, 19 Oct 2023 15:43:36 +0000 Subject: [PATCH 3/6] bump fastrlock --- dist_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist_config.py b/dist_config.py index 1b98a5dc..3d29f4c5 100644 --- a/dist_config.py +++ b/dist_config.py @@ -5,7 +5,7 @@ # Tools to be used for build. CYTHON_VERSION = '0.29.36' -FASTRLOCK_VERSION = '0.8.1' +FASTRLOCK_VERSION = '0.8.2' # Key-value of sdist build settings. # See descriptions of WHEEL_LINUX_CONFIGS for details. From d90cbf4159e1d1aac865f809cb9573c071701770 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Fri, 20 Oct 2023 03:19:34 +0000 Subject: [PATCH 4/6] imp module removed in Python 3.12 --- dist_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dist_utils.py b/dist_utils.py index bf4586f7..6b33de05 100644 --- a/dist_utils.py +++ b/dist_utils.py @@ -2,7 +2,6 @@ import ctypes import ctypes.util -import imp import os from dist_config import WHEEL_PYTHON_VERSIONS @@ -39,7 +38,9 @@ def wheel_name(pkg_name, version, python_version, platform_tag): def get_version_from_source_tree(source_tree): version_file_path = '{}/cupy/_version.py'.format(source_tree) - return imp.load_source('_version', version_file_path).__version__ + with open(version_file_path) as f: + exec(f.read()) + return __version__ def get_system_cuda_version(cudart_name='cudart'): From 2ae90ec165f297ce7aa1c7b24cb8b49becc6ac34 Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Fri, 20 Oct 2023 03:21:16 +0000 Subject: [PATCH 5/6] flake8 --- dist_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist_utils.py b/dist_utils.py index 6b33de05..9579f1ce 100644 --- a/dist_utils.py +++ b/dist_utils.py @@ -40,7 +40,7 @@ def get_version_from_source_tree(source_tree): version_file_path = '{}/cupy/_version.py'.format(source_tree) with open(version_file_path) as f: exec(f.read()) - return __version__ + return __version__ # noqa def get_system_cuda_version(cudart_name='cudart'): From 477ff861fb3c2f1d29a05a3cdef7425f8fc1fbfb Mon Sep 17 00:00:00 2001 From: Kenichi Maehashi Date: Fri, 20 Oct 2023 04:52:40 +0000 Subject: [PATCH 6/6] fix --- dist_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist_utils.py b/dist_utils.py index 9579f1ce..15200eb2 100644 --- a/dist_utils.py +++ b/dist_utils.py @@ -40,7 +40,7 @@ def get_version_from_source_tree(source_tree): version_file_path = '{}/cupy/_version.py'.format(source_tree) with open(version_file_path) as f: exec(f.read()) - return __version__ # noqa + return locals()['__version__'] def get_system_cuda_version(cudart_name='cudart'):