Skip to content

Commit

Permalink
use rapids-build-backend (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jun 3, 2024
1 parent 8f1950b commit d49e708
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 14 deletions.
4 changes: 0 additions & 4 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

set -euo pipefail

package_name="libucx"
package_dir="python/libucx"
pyproject_file="${package_dir}/pyproject.toml"

source rapids-configure-sccache
source rapids-date-string

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"
sed -i -E "s/^name = \"${package_name}(.*)?\"$/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}

python -m pip wheel "${package_dir}"/ -w "${package_dir}"/dist -vvv --no-deps --disable-pip-version-check

Expand Down
2 changes: 1 addition & 1 deletion ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package_name="libucx"
WHEELHOUSE="${PWD}/dist/"
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="ucx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp "${WHEELHOUSE}"
python -m pip install "${package_name}-${RAPIDS_PY_CUDA_SUFFIX}" --find-links "${WHEELHOUSE}"
python -m pip install "${WHEELHOUSE}/${package_name}_${RAPIDS_PY_CUDA_SUFFIX}"*.whl
python -c "import libucx; libucx.load_library(); print('Loaded libucx libraries successfully!')"
9 changes: 3 additions & 6 deletions python/libucx/libucx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@
# limitations under the License.
#

import importlib.resources

from ._version import __git_commit__, __version__
from .load import load_library

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

__all__ = [
"__git_commit__",
"load_library",
"__version__",
]
30 changes: 30 additions & 0 deletions python/libucx/libucx/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import importlib.resources

__version__ = (
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__"]
18 changes: 15 additions & 3 deletions python/libucx/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

[build-system]
build-backend = "setuptools.build_meta"
build-backend = "rapids_build_backend.build"
requires = [
"packaging",
"rapids-build-backend>=0.3.0,<0.4.0dev0",
"setuptools>=64.0.0",
"wheel",
]

[project]
Expand Down Expand Up @@ -33,6 +34,17 @@ libucx = "libucx"
[project.urls]
Homepage = "https://github.com/openucx/ucx"

[tool.rapids-build-backend]
build-backend = "setuptools.build_meta"
commit-files = [
"libucx/GIT_COMMIT"
]
dependencies-file = ""
requires = [
"packaging",
"wheel",
]

[tool.setuptools]
include-package-data = true

Expand Down

0 comments on commit d49e708

Please sign in to comment.