Skip to content

Commit

Permalink
Remove hard-coding of RAPIDS version where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Mar 8, 2024
1 parent b05b429 commit e57b27b
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
libucxx

export RAPIDS_VERSION_NUMBER="24.04"
export UCXX_VERSION="$(cat VERSION)"
export RAPIDS_DOCS_DIR="$(mktemp -d)"

rapids-logger "Build CPP docs"
Expand Down
15 changes: 0 additions & 15 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,11 @@ function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

# C++ update
sed_runner 's/'"libucxx_version .*)"'/'"libucxx_version ${NEXT_FULL_TAG})"'/g' cpp/CMakeLists.txt

# Python updates
sed_runner 's/'"ucxx_version .*)"'/'"ucxx_version ${NEXT_FULL_TAG})"'/g' python/CMakeLists.txt
sed_runner "s/^__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/ucxx/__init__.py
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pyproject.toml
sed_runner "s/^__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/distributed-ucxx/distributed_ucxx/__init__.py
sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/distributed-ucxx/pyproject.toml


# bump RAPIDS libs
sed_runner "/- librmm =/ s/=.*/=${NEXT_RAPIDS_VERSION}/g" conda/recipes/ucxx/meta.yaml
sed_runner "/- rmm =/ s/=.*/=${NEXT_RAPIDS_VERSION}/g" conda/recipes/ucxx/meta.yaml
sed_runner "/- rapids-dask-dependency =/ s/=.*/=${NEXT_RAPIDS_VERSION}/g" conda/recipes/ucxx/meta.yaml

# doxyfile update
sed_runner 's/PROJECT_NUMBER = .*/PROJECT_NUMBER = '${NEXT_FULL_TAG}'/g' cpp/doxygen/Doxyfile

DEPENDENCIES=(
cudf
dask-cuda
Expand Down Expand Up @@ -84,4 +70,3 @@ sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_RAPIDS_VERSION}\/RAPID
for FILE in .github/workflows/*.yaml; do
sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_RAPIDS_VERSION}/g" "${FILE}"
done
sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_RAPIDS_VERSION}\"/g" ci/build_docs.sh
10 changes: 8 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ include(rapids-cpm)
include(rapids-export)
include(rapids-find)

set(libucxx_version 0.37.00)
file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION" _version_contents)
if(_version_contents MATCHES "^([^\n]*)\n$")
set(libucxx_version "${CMAKE_MATCH_1}")
else()
string(REPLACE "\n" "\n " _version_contents_formatted "${_version_contents}")
message(FATAL_ERROR "Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}")
endif()

project(
UCXX
Expand Down Expand Up @@ -307,7 +313,7 @@ rapids_export(
add_custom_command(
OUTPUT UCXX_DOXYGEN
WORKING_DIRECTORY ${UCXX_SOURCE_DIR}/doxygen
COMMAND doxygen Doxyfile
COMMAND ${CMAKE_COMMAND} -E env "UCXX_VERSION=${libucxx_version}" doxygen Doxyfile
VERBATIM
COMMENT "Custom command for building ucxx doxygen docs."
)
Expand Down
2 changes: 1 addition & 1 deletion cpp/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = libucxx
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 0.37.00
PROJECT_NUMBER = $(UCXX_VERSION)

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
8 changes: 7 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

set(ucxx_version 0.37.00)
file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION" _version_contents)
if(_version_contents MATCHES "^([^\n]*)\n$")
set(ucxx_version "${CMAKE_MATCH_1}")
else()
string(REPLACE "\n" "\n " _version_contents_formatted "${_version_contents}")
message(FATAL_ERROR "Could not determine ucxx version. Contents of VERSION file:\n ${_version_contents_formatted}")
endif()

include(../fetch_rapids.cmake)

Expand Down
2 changes: 1 addition & 1 deletion python/distributed-ucxx/distributed_ucxx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from . import distributed_patches # noqa: F401


__version__ = "0.37.00"
from ._version import __version__
8 changes: 7 additions & 1 deletion python/distributed-ucxx/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ build-backend = "setuptools.build_meta"
requires = [
"setuptools>=64.0.0",
"tomli",
"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]
name = "distributed-ucxx"
version = "0.37.00"
dynamic = ["version"]
description = "UCX communication module for Dask Distributed"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand Down Expand Up @@ -112,3 +113,8 @@ exclude = [
"docs.*",
"tests.*",
]

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "distributed_ucxx/VERSION"
regex = "(?P<value>.*)"
7 changes: 6 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requires = [

[project]
name = "ucxx"
version = "0.37.00"
dynamic = ["version"]
description = "Python Bindings for the Unified Communication X library (UCX)"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
Expand Down Expand Up @@ -102,6 +102,11 @@ sdist.exclude = ["*tests*"]
sdist.reproducible = true
wheel.packages = ["ucxx"]

[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.regex"
input = "ucxx/VERSION"
regex = "(?P<value>.*)"

[tool.ruff]
select = ["E", "F", "W"]
ignore = [
Expand Down
2 changes: 1 addition & 1 deletion python/ucxx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _is_mig_device(handle):
os.environ["UCX_MAX_RNDV_RAILS"] = "1"


__version__ = "0.37.00"
from ._version import __version__
__ucx_version__ = "%d.%d.%d" % get_ucx_version()

if get_ucx_version() < (1, 11, 1):
Expand Down

0 comments on commit e57b27b

Please sign in to comment.