From 9030c519d57eb0047bff541de14e4ed1c1c20274 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:03:57 -0700 Subject: [PATCH 01/21] Enable consistent versioning --- ci/build_cpp.sh | 4 ++- ci/build_python.sh | 13 +++++++-- ci/build_wheel.sh | 39 +++++++++++++++++++++---- ci/release/apply_wheel_modifications.sh | 22 -------------- conda/recipes/cuml/meta.yaml | 4 +-- conda/recipes/libcuml/meta.yaml | 4 +-- python/cuml/__init__.py | 1 + python/pyproject.toml | 5 +++- 8 files changed, 57 insertions(+), 35 deletions(-) delete mode 100755 ci/release/apply_wheel_modifications.sh diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index bc6b2f23b4..d098a327a3 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,8 +9,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +version_override=$(rapids-generate-version) + rapids-logger "Begin cpp build" -rapids-conda-retry mambabuild conda/recipes/libcuml +RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild conda/recipes/libcuml rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 9bee12371c..2e7f9682e6 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -9,13 +9,22 @@ export CMAKE_GENERATOR=Ninja rapids-print-env +package_name="cuml" +package_dir="python" + +version_override=$(rapids-generate-version) +commit_override=$(git rev-parse HEAD) + +sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${package_dir}/${package_name}/__init__.py +sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${package_dir}/${package_name}/__init__.py + rapids-logger "Begin py build" CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuml @@ -24,7 +33,7 @@ rapids-conda-retry mambabuild \ # version RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then - rapids-conda-retry mambabuild \ + RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild \ --no-test \ conda/recipes/cuml-cpu fi diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 979a17014b..275d4790c7 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -3,6 +3,9 @@ set -euo pipefail +package_name="cuml" +package_dir="python" + source rapids-configure-sccache source rapids-date-string @@ -12,11 +15,37 @@ version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}" -echo "The package name and/or version was modified in the package source. The git diff is:" -git diff - -cd python/ +# 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 and version override. +pyproject_file="${package_dir}/pyproject.toml" +init_file="${package_dir}/${package_name}/__init__.py" + +sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} +sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file} +sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_file} + +# For nightlies we want to ensure that we're pulling in alphas as well. The +# easiest way to do so is to augment the spec with a constraint containing a +# min alpha version that doesn't affect the version bounds but does allow usage +# of alpha versions for that dependency without --pre +alpha_spec='' +if ! rapids-is-release-build; then + alpha_spec=',>=0.0.0a0' +fi + +for dep in cudf pylibraft raft-dask rmm; do + sed -i "s/${dep}(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} +done + +if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then + sed -i "s/cuda-python[<=>\.,0-9]*/cuda-python>=12.0,<13.0/g" ${pyproject_file} + sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} +fi + +cd ${package_dir} SKBUILD_CONFIGURE_OPTIONS="-DCUML_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DDISABLE_DEPRECATION_WARNINGS=ON -DCPM_cumlprims_mg_SOURCE=${GITHUB_WORKSPACE}/cumlprims_mg/" \ python -m pip wheel . \ diff --git a/ci/release/apply_wheel_modifications.sh b/ci/release/apply_wheel_modifications.sh deleted file mode 100755 index fb5971fa5e..0000000000 --- a/ci/release/apply_wheel_modifications.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. -# -# Usage: bash apply_wheel_modifications.sh - -VERSION=${1} -CUDA_SUFFIX=${2} - -# pyproject.toml versions -sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/pyproject.toml - -# pyproject.toml cuda suffixes -sed -i "s/^name = \"cuml\"/name = \"cuml${CUDA_SUFFIX}\"/g" python/pyproject.toml -sed -i "s/cudf/cudf${CUDA_SUFFIX}/g" python/pyproject.toml -sed -i "s/pylibraft/pylibraft${CUDA_SUFFIX}/g" python/pyproject.toml -sed -i "s/raft-dask/raft-dask${CUDA_SUFFIX}/g" python/pyproject.toml -sed -i "s/rmm/rmm${CUDA_SUFFIX}/g" python/pyproject.toml - -if [[ $CUDA_SUFFIX == "-cu12" ]]; then - sed -i "s/cuda-python[<=>\.,0-9]*/cuda-python>=12.0,<13.0/g" python/pyproject.toml - sed -i "s/cupy-cuda11x/cupy-cuda12x/g" python/pyproject.toml -fi diff --git a/conda/recipes/cuml/meta.yaml b/conda/recipes/cuml/meta.yaml index 817776fa13..4f3eb26b64 100644 --- a/conda/recipes/cuml/meta.yaml +++ b/conda/recipes/cuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} +{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} @@ -12,7 +12,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} diff --git a/conda/recipes/libcuml/meta.yaml b/conda/recipes/libcuml/meta.yaml index 34d3521869..36f2f3057c 100644 --- a/conda/recipes/libcuml/meta.yaml +++ b/conda/recipes/libcuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %} +{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} @@ -11,7 +11,7 @@ package: name: libcuml-split source: - git_url: ../../.. + path: ../../.. build: ignore_run_exports_from: diff --git a/python/cuml/__init__.py b/python/cuml/__init__.py index 6c25b5d2d8..ad542085a9 100644 --- a/python/cuml/__init__.py +++ b/python/cuml/__init__.py @@ -117,6 +117,7 @@ # Version configuration __version__ = "23.12.00" +__git_commit__ = "HEAD" def __getattr__(name): diff --git a/python/pyproject.toml b/python/pyproject.toml index 32f1b7a59e..b54a182838 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -48,7 +48,7 @@ filterwarnings = [ [project] name = "cuml" -version = "23.12.00" +dynamic = ["version"] description = "cuML - RAPIDS ML Algorithms" readme = { file = "README.md", content-type = "text/markdown" } authors = [ @@ -104,6 +104,9 @@ Documentation = "https://docs.rapids.ai/api/cuml/stable/" [tool.setuptools] license-files = ["LICENSE"] +[tool.setuptools.dynamic] +version = {attr = "cuml.__version__"} + [tool.black] line-length = 79 target-version = ["py39"] From 935455c179bc128f64d72494e3b57a6fbff257bd Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:15:12 -0700 Subject: [PATCH 02/21] Add missing commit override --- ci/build_wheel.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 275d4790c7..1d17f30c8c 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -12,6 +12,7 @@ source rapids-date-string # Use gha-tools rapids-pip-wheel-version to generate wheel version then # update the necessary files version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" +commit_override=$(git rev-parse HEAD) RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" From e92a24fa97ab66de1aaf92f04b6be071f5626759 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:20:54 -0700 Subject: [PATCH 03/21] Enable extended regex --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 1d17f30c8c..a939ff3dac 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -38,7 +38,7 @@ if ! rapids-is-release-build; then fi for dep in cudf pylibraft raft-dask rmm; do - sed -i "s/${dep}(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} + sed -r -i "s/${dep}(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} done if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then From 61967ada3f4df8ad5be976b52645f1523ee0f2fe Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:29:39 -0700 Subject: [PATCH 04/21] Remove extraneous equals --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index a939ff3dac..274aa991fa 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -38,7 +38,7 @@ if ! rapids-is-release-build; then fi for dep in cudf pylibraft raft-dask rmm; do - sed -r -i "s/${dep}(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} + sed -r -i "s/${dep}==(.*)\"/${dep}${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} done if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then From 09095506d316394a4afd0da916be344106eb731f Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:39:47 -0700 Subject: [PATCH 05/21] Add missing quotes --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 274aa991fa..ead5340365 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -25,7 +25,7 @@ pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file} +sed -i "s/__version__ = .*/__version__ = \"${version_override}\"/g" ${init_file} sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The From 6b338a965b4be7e566649c59fc6fd6f7d27d4eb2 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 17:40:34 -0700 Subject: [PATCH 06/21] Use the new version tool for wheels too --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index ead5340365..551c3f35cf 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -11,7 +11,7 @@ source rapids-date-string # Use gha-tools rapids-pip-wheel-version to generate wheel version then # update the necessary files -version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" +version_override=$(rapids-generate-version) commit_override=$(git rev-parse HEAD) RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" From 33f694046abad886894bd57d3683bff8a4eb7da8 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 18:12:20 -0700 Subject: [PATCH 07/21] Remove extra quotes --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 551c3f35cf..4ddc18d789 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -25,7 +25,7 @@ pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "s/__version__ = .*/__version__ = \"${version_override}\"/g" ${init_file} +sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file} sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The From 6fe34f7086b9c6f50821dd2d2b07dadd0e91fc33 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 5 Oct 2023 23:13:05 -0700 Subject: [PATCH 08/21] Also set version for cuml-cpu conda package --- conda/recipes/cuml-cpu/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/recipes/cuml-cpu/meta.yaml b/conda/recipes/cuml-cpu/meta.yaml index d4497a65fb..5e650ce6a6 100644 --- a/conda/recipes/cuml-cpu/meta.yaml +++ b/conda/recipes/cuml-cpu/meta.yaml @@ -2,7 +2,7 @@ # Usage: # conda build . -c conda-forge -c numba -c rapidsai -c pytorch -{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set py_version = environ['CONDA_PY'] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} @@ -11,7 +11,7 @@ package: version: {{ version }} source: - git_url: ../../.. + path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} From 9e26d4e3791851bcd1eceae692dbf2f950dfe17c Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Oct 2023 10:27:59 -0700 Subject: [PATCH 09/21] Address PR feedback --- ci/build_cpp.sh | 4 ++-- ci/build_python.sh | 8 ++++---- ci/build_wheel.sh | 6 +++++- python/cuml/__init__.py | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index d098a327a3..0a6a649fd0 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -9,10 +9,10 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -version_override=$(rapids-generate-version) +version=$(rapids-generate-version) rapids-logger "Begin cpp build" -RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild conda/recipes/libcuml +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcuml rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 2e7f9682e6..da6ddeb987 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -12,10 +12,10 @@ rapids-print-env package_name="cuml" package_dir="python" -version_override=$(rapids-generate-version) +version=$(rapids-generate-version) commit_override=$(git rev-parse HEAD) -sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${package_dir}/${package_name}/__init__.py +sed -i "s/__version__ = .*/__version__ = ${version}/g" ${package_dir}/${package_name}/__init__.py sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${package_dir}/${package_name}/__init__.py rapids-logger "Begin py build" @@ -24,7 +24,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild \ +RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuml @@ -33,7 +33,7 @@ RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild \ # version RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then - RAPIDS_PACKAGE_VERSION=${version_override} rapids-conda-retry mambabuild \ + RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ --no-test \ conda/recipes/cuml-cpu fi diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 4ddc18d789..fde0f4a3f6 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -11,7 +11,7 @@ source rapids-date-string # Use gha-tools rapids-pip-wheel-version to generate wheel version then # update the necessary files -version_override=$(rapids-generate-version) +version=$(rapids-generate-version) commit_override=$(git rev-parse HEAD) RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" @@ -25,7 +25,11 @@ pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} +<<<<<<< Updated upstream sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file} +======= +sed -i "s/__version__ = .*/__version__ = \"${version}\"/g" ${init_file} +>>>>>>> Stashed changes sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The diff --git a/python/cuml/__init__.py b/python/cuml/__init__.py index ad542085a9..7a55d53285 100644 --- a/python/cuml/__init__.py +++ b/python/cuml/__init__.py @@ -117,7 +117,7 @@ # Version configuration __version__ = "23.12.00" -__git_commit__ = "HEAD" +__git_commit__ = "" def __getattr__(name): From ac2864624f2349b7578e7930ba9b69f2922aed03 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Oct 2023 10:36:03 -0700 Subject: [PATCH 10/21] Change commit_override to git_commit --- ci/build_python.sh | 4 ++-- ci/build_wheel.sh | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index da6ddeb987..8209af86ac 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -13,10 +13,10 @@ package_name="cuml" package_dir="python" version=$(rapids-generate-version) -commit_override=$(git rev-parse HEAD) +git_commit=$(git rev-parse HEAD) sed -i "s/__version__ = .*/__version__ = ${version}/g" ${package_dir}/${package_name}/__init__.py -sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${package_dir}/${package_name}/__init__.py +sed -i "s/__git_commit__ = .*/__git_commit__ = \"${git_commit}\"/g" ${package_dir}/${package_name}/__init__.py rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index fde0f4a3f6..6367ef23a6 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -12,7 +12,7 @@ source rapids-date-string # Use gha-tools rapids-pip-wheel-version to generate wheel version then # update the necessary files version=$(rapids-generate-version) -commit_override=$(git rev-parse HEAD) +git_commit=$(git rev-parse HEAD) RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" @@ -25,12 +25,8 @@ pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -<<<<<<< Updated upstream -sed -i "s/__version__ = .*/__version__ = ${version_override}/g" ${init_file} -======= sed -i "s/__version__ = .*/__version__ = \"${version}\"/g" ${init_file} ->>>>>>> Stashed changes -sed -i "s/__git_commit__ = .*/__git_commit__ = \"${commit_override}\"/g" ${init_file} +sed -i "s/__git_commit__ = .*/__git_commit__ = \"${git_commit}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The # easiest way to do so is to augment the spec with a constraint containing a From d8d171ba8155aa40f4e9c74951e27e6f18bf487f Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Oct 2023 10:44:42 -0700 Subject: [PATCH 11/21] Remove the quotes again --- ci/build_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6367ef23a6..4eead84651 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -25,7 +25,7 @@ pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "s/__version__ = .*/__version__ = \"${version}\"/g" ${init_file} +sed -i "s/__version__ = .*/__version__ = ${version}/g" ${init_file} sed -i "s/__git_commit__ = .*/__git_commit__ = \"${git_commit}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The From dce083f83621da242946ba4c2d4bdaaccc83559b Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Oct 2023 13:10:55 -0700 Subject: [PATCH 12/21] Apply suggestions from code review Co-authored-by: AJ Schmidt --- ci/build_python.sh | 4 ++-- ci/build_wheel.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 8209af86ac..9bd777c4f7 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -15,8 +15,8 @@ package_dir="python" version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) -sed -i "s/__version__ = .*/__version__ = ${version}/g" ${package_dir}/${package_name}/__init__.py -sed -i "s/__git_commit__ = .*/__git_commit__ = \"${git_commit}\"/g" ${package_dir}/${package_name}/__init__.py +sed -i "/__version__/ s/= .*/= ${version}/g" ${package_dir}/${package_name}/__init__.py +sed -i "/__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${package_dir}/${package_name}/__init__.py rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 4eead84651..a2af00b798 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -24,9 +24,9 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" pyproject_file="${package_dir}/pyproject.toml" init_file="${package_dir}/${package_name}/__init__.py" -sed -i "s/^name = \"cuml\"/name = \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "s/__version__ = .*/__version__ = ${version}/g" ${init_file} -sed -i "s/__git_commit__ = .*/__git_commit__ = \"${git_commit}\"/g" ${init_file} +sed -i "/^name.*cuml/ s/= \"cuml\"/= \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} +sed -i "/__version__ / s/= .*/= ${version}/g" ${init_file} +sed -i "/__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${init_file} # For nightlies we want to ensure that we're pulling in alphas as well. The # easiest way to do so is to augment the spec with a constraint containing a From e6b5a37538211bb90956219b2514dd423fc6114c Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 6 Oct 2023 13:12:06 -0700 Subject: [PATCH 13/21] export RAPIDS_PACKAGE_VERSION --- ci/build_python.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 9bd777c4f7..fa0e9afd97 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -14,6 +14,7 @@ package_dir="python" version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) +export RAPIDS_PACKAGE_VERSION=${version} sed -i "/__version__/ s/= .*/= ${version}/g" ${package_dir}/${package_name}/__init__.py sed -i "/__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${package_dir}/${package_name}/__init__.py @@ -24,7 +25,7 @@ CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) # TODO: Remove `--no-test` flag once importing on a CPU # node works correctly -RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ +rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ conda/recipes/cuml @@ -33,7 +34,7 @@ RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ # version RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}" if [[ ${RAPIDS_CUDA_MAJOR} == "11" ]]; then - RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \ + rapids-conda-retry mambabuild \ --no-test \ conda/recipes/cuml-cpu fi From 71ac5427cb14dda5cb6ba884e7ba2d0453d62564 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 9 Oct 2023 14:44:08 -0700 Subject: [PATCH 14/21] Port PR suggestions from rmm --- ci/build_python.sh | 5 +++-- ci/build_wheel.sh | 6 +++--- python/cuml/__init__.py | 5 +---- python/cuml/_version.py | 18 ++++++++++++++++++ python/pyproject.toml | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 python/cuml/_version.py diff --git a/ci/build_python.sh b/ci/build_python.sh index fa0e9afd97..3aa50c53aa 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -16,8 +16,9 @@ version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} -sed -i "/__version__/ s/= .*/= ${version}/g" ${package_dir}/${package_name}/__init__.py -sed -i "/__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${package_dir}/${package_name}/__init__.py +version_file="${package_dir}/${package_name}/_version.py" +sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} +sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file} rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index a2af00b798..f44dd79aa3 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -22,11 +22,11 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" # Patch project metadata files to include the CUDA version suffix and version override. pyproject_file="${package_dir}/pyproject.toml" -init_file="${package_dir}/${package_name}/__init__.py" +version_file="${package_dir}/${package_name}/_version.py" sed -i "/^name.*cuml/ s/= \"cuml\"/= \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "/__version__ / s/= .*/= ${version}/g" ${init_file} -sed -i "/__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${init_file} +sed -i "/^__version__ / s/= .*/= ${version}/g" ${version_file} +sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} # For nightlies we want to ensure that we're pulling in alphas as well. The # easiest way to do so is to augment the spec with a constraint containing a diff --git a/python/cuml/__init__.py b/python/cuml/__init__.py index 7a55d53285..62ab93c1b4 100644 --- a/python/cuml/__init__.py +++ b/python/cuml/__init__.py @@ -114,10 +114,7 @@ from cuml.solvers.cd import CD from cuml.solvers.sgd import SGD from cuml.solvers.qn import QN - -# Version configuration -__version__ = "23.12.00" -__git_commit__ = "" +from cuml._version import __version__, __git_commit__ def __getattr__(name): diff --git a/python/cuml/_version.py b/python/cuml/_version.py new file mode 100644 index 0000000000..ae559168f2 --- /dev/null +++ b/python/cuml/_version.py @@ -0,0 +1,18 @@ +# Copyright (c) 2023, 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. +# + +# Version configuration +__version__ = "23.12.00" +__git_commit__ = "" diff --git a/python/pyproject.toml b/python/pyproject.toml index b54a182838..19998775fe 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -105,7 +105,7 @@ Documentation = "https://docs.rapids.ai/api/cuml/stable/" license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "cuml.__version__"} +version = {attr = "cuml._version.__version__"} [tool.black] line-length = 79 From 77801985d80159a370c5a2604668458ada5cdc07 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 10 Oct 2023 11:46:12 -0700 Subject: [PATCH 15/21] Update build_wheel.sh --- ci/build_wheel.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f44dd79aa3..31cca10b22 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -9,8 +9,6 @@ package_dir="python" source rapids-configure-sccache source rapids-date-string -# Use gha-tools rapids-pip-wheel-version to generate wheel version then -# update the necessary files version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) From ff50d0ac9b4e87de1f5913892456f25605681e63 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 17 Oct 2023 13:45:16 -0700 Subject: [PATCH 16/21] Require package version env var in conda builds --- conda/recipes/cuml-cpu/meta.yaml | 2 +- conda/recipes/cuml/meta.yaml | 2 +- conda/recipes/libcuml/meta.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conda/recipes/cuml-cpu/meta.yaml b/conda/recipes/cuml-cpu/meta.yaml index 5e650ce6a6..83b093dfa9 100644 --- a/conda/recipes/cuml-cpu/meta.yaml +++ b/conda/recipes/cuml-cpu/meta.yaml @@ -2,7 +2,7 @@ # Usage: # conda build . -c conda-forge -c numba -c rapidsai -c pytorch -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set py_version = environ['CONDA_PY'] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} diff --git a/conda/recipes/cuml/meta.yaml b/conda/recipes/cuml/meta.yaml index 4f3eb26b64..04800cb037 100644 --- a/conda/recipes/cuml/meta.yaml +++ b/conda/recipes/cuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} diff --git a/conda/recipes/libcuml/meta.yaml b/conda/recipes/libcuml/meta.yaml index 36f2f3057c..4877f18296 100644 --- a/conda/recipes/libcuml/meta.yaml +++ b/conda/recipes/libcuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ.get('RAPIDS_PACKAGE_VERSION', '0.0.0.dev').strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} From c8da2cea8c88d5f621222667900fe55a10489efb Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 19 Oct 2023 14:50:54 -0700 Subject: [PATCH 17/21] Update update-version.sh --- ci/release/update-version.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 1652a2278d..589e3cab91 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -36,8 +36,7 @@ function sed_runner() { # __init__.py and pyproject.toml versions -sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cuml/__init__.py -sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/pyproject.toml +sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cuml/_version.py sed_runner "s/rmm==.*\",/rmm==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml sed_runner "s/cudf==.*\",/cudf==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml sed_runner "s/pylibraft==.*\",/pylibraft==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml From 23edbe5f78dc2b2919231d8677a386721d592a40 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 24 Oct 2023 12:01:15 -0700 Subject: [PATCH 18/21] Switch to VERSION file --- VERSION | 1 + ci/build_python.sh | 5 ++--- ci/build_wheel.sh | 5 ++--- python/cuml/VERSION | 1 + python/cuml/_version.py | 6 ++++-- python/pyproject.toml | 2 +- python/setup.py | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 VERSION create mode 120000 python/cuml/VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..a193fff41e --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +23.12.00 diff --git a/ci/build_python.sh b/ci/build_python.sh index 3aa50c53aa..32ce7ad376 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -16,9 +16,8 @@ version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} -version_file="${package_dir}/${package_name}/_version.py" -sed -i "/^__version__/ s/= .*/= ${version}/g" ${version_file} -sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" ${version_file} +echo "${version}" | tr -d '"' > VERSION +sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py" rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 31cca10b22..6b7e411772 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -20,11 +20,10 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" # Patch project metadata files to include the CUDA version suffix and version override. pyproject_file="${package_dir}/pyproject.toml" -version_file="${package_dir}/${package_name}/_version.py" sed -i "/^name.*cuml/ s/= \"cuml\"/= \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -sed -i "/^__version__ / s/= .*/= ${version}/g" ${version_file} -sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" ${version_file} +echo "${version}" | tr -d '"' > VERSION +sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py" # For nightlies we want to ensure that we're pulling in alphas as well. The # easiest way to do so is to augment the spec with a constraint containing a diff --git a/python/cuml/VERSION b/python/cuml/VERSION new file mode 120000 index 0000000000..558194c5a5 --- /dev/null +++ b/python/cuml/VERSION @@ -0,0 +1 @@ +../../VERSION \ No newline at end of file diff --git a/python/cuml/_version.py b/python/cuml/_version.py index ae559168f2..7d38ef9dc6 100644 --- a/python/cuml/_version.py +++ b/python/cuml/_version.py @@ -13,6 +13,8 @@ # limitations under the License. # -# Version configuration -__version__ = "23.12.00" +import os.path + +with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version_file: + __version__ = version_file.read().strip() __git_commit__ = "" diff --git a/python/pyproject.toml b/python/pyproject.toml index 19998775fe..8c9eaac179 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -105,7 +105,7 @@ Documentation = "https://docs.rapids.ai/api/cuml/stable/" license-files = ["LICENSE"] [tool.setuptools.dynamic] -version = {attr = "cuml._version.__version__"} +version = {file = "cuml/VERSION"} [tool.black] line-length = 79 diff --git a/python/setup.py b/python/setup.py index 8e6615a2ef..5a30d78201 100644 --- a/python/setup.py +++ b/python/setup.py @@ -109,6 +109,6 @@ def clean_folder(path): packages = find_packages(include=["cuml*"]) setup( packages=packages, - package_data={key: ["*.pxd"] for key in packages}, + package_data={key: ["VERSION", "*.pxd"] for key in packages}, zip_safe=False, ) From 33249c632d6c7b7e6e63e7a85192a6a3cb4bf130 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 24 Oct 2023 12:02:07 -0700 Subject: [PATCH 19/21] update-version.sh --- ci/release/update-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 589e3cab91..4e4a4c1e70 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -35,8 +35,10 @@ function sed_runner() { } -# __init__.py and pyproject.toml versions -sed_runner "/^__version__ / s/= .*/= \"${NEXT_FULL_TAG}\"/g" python/cuml/_version.py +# Centralized version file update +echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION + +# pyproject.toml versions sed_runner "s/rmm==.*\",/rmm==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml sed_runner "s/cudf==.*\",/cudf==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml sed_runner "s/pylibraft==.*\",/pylibraft==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml From b32767e7ac2e2c1869989553bd016fb0cda45784 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 26 Oct 2023 11:26:08 -0700 Subject: [PATCH 20/21] Switch to using importlib.resources --- python/cuml/_version.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/cuml/_version.py b/python/cuml/_version.py index 7d38ef9dc6..87cb6a74d5 100644 --- a/python/cuml/_version.py +++ b/python/cuml/_version.py @@ -13,8 +13,9 @@ # limitations under the License. # -import os.path +import importlib.resources -with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version_file: - __version__ = version_file.read().strip() +__version__ = ( + importlib.resources.files("cuml").joinpath("VERSION").read_text().strip() +) __git_commit__ = "" From 5425001f282048f851903f3de6d8516cab5e18d5 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 30 Oct 2023 10:12:33 -0700 Subject: [PATCH 21/21] Remove now unnecessary quote stripping --- ci/build_python.sh | 2 +- ci/build_wheel.sh | 2 +- ci/release/update-version.sh | 2 +- conda/recipes/cuml-cpu/meta.yaml | 2 +- conda/recipes/cuml/meta.yaml | 2 +- conda/recipes/libcuml/meta.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 32ce7ad376..1332062770 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -16,7 +16,7 @@ version=$(rapids-generate-version) git_commit=$(git rev-parse HEAD) export RAPIDS_PACKAGE_VERSION=${version} -echo "${version}" | tr -d '"' > VERSION +echo "${version}" > VERSION sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py" rapids-logger "Begin py build" diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 6b7e411772..0231726b82 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -22,7 +22,7 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" pyproject_file="${package_dir}/pyproject.toml" sed -i "/^name.*cuml/ s/= \"cuml\"/= \"cuml${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} -echo "${version}" | tr -d '"' > VERSION +echo "${version}" > VERSION sed -i "/^__git_commit__ / s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/_version.py" # For nightlies we want to ensure that we're pulling in alphas as well. The diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 69a8088d8e..9b07a58476 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -36,7 +36,7 @@ function sed_runner() { # Centralized version file update -echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION +echo "${NEXT_FULL_TAG}" > VERSION # pyproject.toml versions sed_runner "s/rmm==.*\",/rmm==${NEXT_SHORT_TAG_PEP440}.*\",/g" python/pyproject.toml diff --git a/conda/recipes/cuml-cpu/meta.yaml b/conda/recipes/cuml-cpu/meta.yaml index 83b093dfa9..cb88ac22b7 100644 --- a/conda/recipes/cuml-cpu/meta.yaml +++ b/conda/recipes/cuml-cpu/meta.yaml @@ -2,7 +2,7 @@ # Usage: # conda build . -c conda-forge -c numba -c rapidsai -c pytorch -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') + environ.get('VERSION_SUFFIX', '') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %} {% set py_version = environ['CONDA_PY'] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} diff --git a/conda/recipes/cuml/meta.yaml b/conda/recipes/cuml/meta.yaml index 04800cb037..7170febead 100644 --- a/conda/recipes/cuml/meta.yaml +++ b/conda/recipes/cuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} diff --git a/conda/recipes/libcuml/meta.yaml b/conda/recipes/libcuml/meta.yaml index 4877f18296..b190a39625 100644 --- a/conda/recipes/libcuml/meta.yaml +++ b/conda/recipes/libcuml/meta.yaml @@ -1,6 +1,6 @@ # Copyright (c) 2018-2023, NVIDIA CORPORATION. -{% set version = environ['RAPIDS_PACKAGE_VERSION'].strip('"').lstrip('v') %} +{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %}