From 94942cb08b51c8eba29ada2d78503f30963aad63 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 7 Dec 2023 17:53:51 +0000 Subject: [PATCH 1/3] Switch to scikit-build-core --- .../environments/all_cuda-118_arch-x86_64.yaml | 2 +- .../environments/all_cuda-120_arch-x86_64.yaml | 2 +- conda/recipes/kvikio/meta.yaml | 2 +- dependencies.yaml | 13 ++++++++++--- legate/pyproject.toml | 2 +- python/CMakeLists.txt | 8 ++------ python/README.md | 1 + python/pyproject.toml | 14 ++++++++++---- python/setup.py | 17 ----------------- 9 files changed, 27 insertions(+), 34 deletions(-) create mode 120000 python/README.md delete mode 100644 python/setup.py diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 31963d7547..c31b7d44f3 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -32,7 +32,7 @@ dependencies: - pytest - pytest-cov - python>=3.9,<3.11 -- scikit-build>=0.13.1 +- scikit-build-core>=0.7.0 - sphinx - sphinx-click - sphinx_rtd_theme diff --git a/conda/environments/all_cuda-120_arch-x86_64.yaml b/conda/environments/all_cuda-120_arch-x86_64.yaml index 7446352b54..e0cfd064b4 100644 --- a/conda/environments/all_cuda-120_arch-x86_64.yaml +++ b/conda/environments/all_cuda-120_arch-x86_64.yaml @@ -31,7 +31,7 @@ dependencies: - pytest - pytest-cov - python>=3.9,<3.11 -- scikit-build>=0.13.1 +- scikit-build-core>=0.7.0 - sphinx - sphinx-click - sphinx_rtd_theme diff --git a/conda/recipes/kvikio/meta.yaml b/conda/recipes/kvikio/meta.yaml index 52d81936ba..dbc6ca007b 100644 --- a/conda/recipes/kvikio/meta.yaml +++ b/conda/recipes/kvikio/meta.yaml @@ -63,7 +63,7 @@ requirements: {% endif %} - cuda-version ={{ cuda_version }} - nvcomp {{ nvcomp_version }} - - scikit-build >=0.13.1 + - scikit-build-core>=0.7.0 - libkvikio ={{ version }} run: - python diff --git a/dependencies.yaml b/dependencies.yaml index d3e5da5eb1..e6aacf304c 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -7,6 +7,7 @@ files: arch: [x86_64] includes: - build + - build_legate_wheel - checks - cudatoolkit - docs @@ -65,6 +66,7 @@ files: table: build-system includes: - build + - build_legate_wheel legate_py_run: output: pyproject pyproject_dir: legate @@ -94,15 +96,14 @@ dependencies: - cmake>=3.26.4 - cython>=3.0.0 - ninja - - scikit-build>=0.13.1 - output_types: conda packages: - c-compiler - cxx-compiler + - scikit-build-core>=0.7.0 - output_types: [requirements, pyproject] packages: - - setuptools - - wheel + - scikit-build-core[pyproject]>=0.7.0 specific: - output_types: conda matrices: @@ -133,6 +134,12 @@ dependencies: packages: - cuda-version=12.0 - cuda-nvcc + build_legate_wheel: + common: + - output_types: [requirements, pyproject] + packages: + - setuptools + - wheel checks: common: - output_types: [conda, requirements] diff --git a/legate/pyproject.toml b/legate/pyproject.toml index 1e831dec3b..b1c30b53ab 100644 --- a/legate/pyproject.toml +++ b/legate/pyproject.toml @@ -7,7 +7,7 @@ requires = [ "cmake>=3.26.4", "cython>=3.0.0", "ninja", - "scikit-build>=0.13.1", + "scikit-build-core[pyproject]>=0.7.0", "setuptools", "wheel", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`. diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9e6bfb3c64..eede4fd9a1 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -25,11 +25,7 @@ rapids_cuda_init_architectures(kvikio-python) project( kvikio-python VERSION ${kvikio_version} - LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C - # language to be enabled here. The test project that is built in scikit-build to verify - # various linking options for the python library is hardcoded to build with C, so until - # that is fixed we need to keep C. - C CXX CUDA + LANGUAGES CXX CUDA ) option(FIND_KVIKIO_CPP @@ -53,7 +49,7 @@ if(NOT KvikIO_FOUND) install(TARGETS kvikio DESTINATION ${cython_lib_dir}) endif() -include(rapids-cython) +include(rapids-cython-core) rapids_cython_init() add_subdirectory(cmake) diff --git a/python/README.md b/python/README.md new file mode 120000 index 0000000000..32d46ee883 --- /dev/null +++ b/python/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/python/pyproject.toml b/python/pyproject.toml index dcb79c6f76..e76b567650 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,14 +2,12 @@ # See file LICENSE for terms. [build-system] -build-backend = "setuptools.build_meta" +build-backend = "scikit_build_core.build" requires = [ "cmake>=3.26.4", "cython>=3.0.0", "ninja", - "scikit-build>=0.13.1", - "setuptools", - "wheel", + "scikit-build-core[pyproject]>=0.7.0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`. [project] @@ -109,3 +107,11 @@ ignore_missing_imports = true [project.entry-points."numcodecs.codecs"] nvcomp_batch = "kvikio.nvcomp_codec:NvCompBatchCodec" + +[tool.scikit-build] +cmake.minimum-version = "3.26.4" +ninja.make-fallback = true +cmake.build-type = "Release" +sdist.reproducible = true +wheel.packages = ["kvikio"] +build-dir = "build/{wheel_tag}" diff --git a/python/setup.py b/python/setup.py deleted file mode 100644 index 226eb148b9..0000000000 --- a/python/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. -# See file LICENSE for terms. - -from setuptools import find_packages -from skbuild import setup - -setup( - packages=find_packages(exclude=["tests*"]), - package_data={ - # Note: A dict comprehension with an explicit copy is necessary (rather - # than something simpler like a dict.fromkeys) because otherwise every - # package will refer to the same list and skbuild modifies it in place. - key: ["*.pyi", "*.pxd"] - for key in find_packages(include=["kvikio._lib"]) - }, - zip_safe=False, -) From 39c91965b94f519bfdb917d8a3bd3d4c88828a46 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 13 Dec 2023 00:11:47 +0000 Subject: [PATCH 2/3] Sort table --- python/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index e76b567650..4fda954cde 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -109,9 +109,9 @@ ignore_missing_imports = true nvcomp_batch = "kvikio.nvcomp_codec:NvCompBatchCodec" [tool.scikit-build] +build-dir = "build/{wheel_tag}" +cmake.build-type = "Release" cmake.minimum-version = "3.26.4" ninja.make-fallback = true -cmake.build-type = "Release" sdist.reproducible = true wheel.packages = ["kvikio"] -build-dir = "build/{wheel_tag}" From b77d835a249b32123768937cd61045f25a7be899 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 13 Dec 2023 17:55:10 +0000 Subject: [PATCH 3/3] Fix space --- conda/recipes/kvikio/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/kvikio/meta.yaml b/conda/recipes/kvikio/meta.yaml index dbc6ca007b..3727575663 100644 --- a/conda/recipes/kvikio/meta.yaml +++ b/conda/recipes/kvikio/meta.yaml @@ -63,7 +63,7 @@ requirements: {% endif %} - cuda-version ={{ cuda_version }} - nvcomp {{ nvcomp_version }} - - scikit-build-core>=0.7.0 + - scikit-build-core >=0.7.0 - libkvikio ={{ version }} run: - python