Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rapids-build-backend #88

Merged
merged 6 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ source "$(dirname "$0")/install_latest_cuda_toolkit.sh"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# This is the version of the suffix with a preceding hyphen. It's used
# everywhere except in the final wheel name.
PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"

# Patch project metadata files to include the CUDA version suffix.
sed -i "s/^name = \"pynvjitlink\"/name = \"pynvjitlink${PACKAGE_CUDA_SUFFIX}\"/g" pyproject.toml

rapids-logger "Build wheel"
rapids-logger "Build wheel"s
bdice marked this conversation as resolved.
Show resolved Hide resolved
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p ./dist
python -m pip wheel . --wheel-dir=./dist -vvv --disable-pip-version-check --no-deps

Expand Down
1 change: 1 addition & 0 deletions conda/recipes/pynvjitlink/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ requirements:
- cuda-version {{ cuda_compiler_version }}
- python
- pip
- rapids-build-backend >=0.3.0,<0.4.0dev0
- scikit-build-core
run:
- python
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dependencies:
common:
- output_types: [requirements, pyproject]
packages:
- rapids-build-backend >=0.3.0,<0.4.0dev0
- scikit-build-core[pyproject]>=0.7.0
checks:
common:
Expand Down
9 changes: 7 additions & 2 deletions pynvjitlink/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

from pynvjitlink.api import NvJitLinker, NvJitLinkError
from pynvjitlink._version import __version__
from pynvjitlink._version import __git_commit__, __version__

__all__ = ["NvJitLinker", "NvJitLinkError", "__version__"]
__all__ = [
"__git_commit__",
"NvJitLinker",
"NvJitLinkError",
"__version__",
]
14 changes: 13 additions & 1 deletion pynvjitlink/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,17 @@
import importlib.resources

__version__ = (
importlib.resources.files("pynvjitlink").joinpath("VERSION").read_text().strip()
importlib.resources.files(__package__).joinpath("VERSION").read_text().strip()
)

try:
__git_commit__ = (
importlib.resources.files(__package__)
.joinpath("GIT_COMMIT")
.read_text()
.strip()
)
except FileNotFoundError:
__git_commit__ = ""

__all__ = ["__git_commit__", "__version__"]
12 changes: 12 additions & 0 deletions pynvjitlink/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

import pynvjitlink


def test_version_constants_are_populated():
# __git_commit__ will only be non-empty in a built distribution
assert isinstance(pynvjitlink.__git_commit__, str)

# __version__ should always be non-empty
assert isinstance(pynvjitlink.__version__, str)
assert len(pynvjitlink.__version__) > 0
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.

[tool.rapids-build-backend]
build-backend = "scikit_build_core.build"
dependencies-file = "dependencies.yaml"

[tool.scikit-build]
cmake.minimum-version = "3.26.4"
cmake.verbose = true
Expand All @@ -9,9 +13,10 @@ wheel.packages = ["pynvjitlink"]

[build-system]
requires = [
"rapids-build-backend >=0.3.0,<0.4.0dev0",
"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`.
build-backend = "scikit_build_core.build"
build-backend = "rapids_build_backend.build"

[project]
name = "pynvjitlink"
Expand Down
Loading