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/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..28da000ef0 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,6 +16,9 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) set(kvikio_version 24.02.00) +set(rapids-cmake-repo "vyasr/rapids-cmake") +set(rapids-cmake-branch "feat/scikit-build-core") + include(../cpp/cmake/fetch_rapids.cmake) include(rapids-cpm) rapids_cpm_init() @@ -25,11 +28,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 +52,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, -)