Skip to content

Commit

Permalink
Switch to scikit-build-core (#1287)
Browse files Browse the repository at this point in the history
Contributes to rapidsai/build-planning#2

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #1287
  • Loading branch information
vyasr authored Dec 13, 2023
1 parent 53c8043 commit 57ed533
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CUDA/GPU requirements:
You can obtain CUDA from [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads)

Python requirements:
* `scikit-build`
* `scikit-build-core`
* `cuda-python`
* `cython`

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ fi
# Build and install the rmm Python package
if (( NUMARGS == 0 )) || hasArg rmm; then
echo "building and installing rmm..."
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS}" python -m pip install --no-build-isolation --no-deps ${REPODIR}/python
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" python -m pip install --no-build-isolation --no-deps ${REPODIR}/python
fi
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- spdlog>=1.12.0,<1.13
- sphinx
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx_rtd_theme
- sysroot_linux-64==2.17
- tomli
name: all_cuda-118_arch-x86_64
3 changes: 1 addition & 2 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.11
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- spdlog>=1.12.0,<1.13
- sphinx
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx_rtd_theme
- sysroot_linux-64==2.17
- tomli
name: all_cuda-120_arch-x86_64
4 changes: 1 addition & 3 deletions conda/recipes/rmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ requirements:
- cython >=3.0.0
- librmm ={{ version }}
- python
- scikit-build >=0.13.1
- setuptools >=61.0.0
- tomli # [py<311]
- scikit-build-core >=0.7.0
run:
{% if cuda_major == "11" %}
- cudatoolkit
Expand Down
8 changes: 3 additions & 5 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,17 @@ dependencies:
- &cmake_ver cmake>=3.26.4
- cython>=3.0.0
- ninja
- scikit-build>=0.13.1
- tomli
- output_types: conda
packages:
- c-compiler
- cxx-compiler
- fmt>=10.1.1,<11
- scikit-build-core>=0.7.0
- spdlog>=1.12.0,<1.13
- python>=3.9,<3.11
- output_types: pyproject
- output_types: [requirements, pyproject]
packages:
- wheel
- setuptools>=61.0.0
- scikit-build-core[pyproject]>=0.7.0
specific:
- output_types: conda
matrices:
Expand Down
8 changes: 2 additions & 6 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ include(../fetch_rapids.cmake)
project(
rmm-python
VERSION ${rmm_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)
LANGUAGES CXX)

option(FIND_RMM_CPP "Search for existing RMM C++ installations before defaulting to local files"
OFF)
Expand All @@ -45,7 +41,7 @@ if(NOT rmm_FOUND)
add_subdirectory(../ rmm-cpp EXCLUDE_FROM_ALL)
endif()

include(rapids-cython)
include(rapids-cython-core)
rapids_cython_init()

add_compile_definitions("SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
Expand Down
22 changes: 13 additions & 9 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
# limitations under the License.

[build-system]
build-backend = "setuptools.build_meta"
build-backend = "scikit_build_core.build"
requires = [
"cmake>=3.26.4",
"cuda-python>=11.7.1,<12.0a0",
"cython>=3.0.0",
"ninja",
"scikit-build>=0.13.1",
"setuptools>=61.0.0",
"tomli",
"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]
Expand Down Expand Up @@ -112,8 +109,15 @@ skip = [
"__init__.py",
]

[tool.setuptools]
license-files = ["LICENSE"]
[tool.scikit-build]
build-dir = "build/{wheel_tag}"
cmake.build-type = "Release"
cmake.minimum-version = "3.26.4"
ninja.make-fallback = true
sdist.reproducible = true
wheel.packages = ["rmm"]

[tool.setuptools.dynamic]
version = {file = "rmm/VERSION"}
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "rmm/VERSION"
regex = "(?P<value>.*)"
11 changes: 0 additions & 11 deletions python/setup.py

This file was deleted.

0 comments on commit 57ed533

Please sign in to comment.