From a661e09e78f7625a9bf7a6c73e194ba6cd72959e Mon Sep 17 00:00:00 2001 From: Kyle Edwards Date: Fri, 8 Mar 2024 09:40:37 -0500 Subject: [PATCH] Remove hard-coding of RAPIDS version (#711) * Read `cucim.__version__` in docs build * Remove update from `ci/release/update-version.sh` Issue: https://github.com/rapidsai/build-planning/issues/15 Authors: - Kyle Edwards (https://github.com/KyleFromNVIDIA) Approvers: - Bradley Dice (https://github.com/bdice) - Jake Awe (https://github.com/AyodeAwe) URL: https://github.com/rapidsai/cucim/pull/711 --- ci/release/update-version.sh | 4 ---- docs/source/conf.py | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 7531110c2..12816e1b3 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -30,10 +30,6 @@ function sed_runner() { sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak } -# RTD update -sed_runner 's/version = .*/version = "'"${NEXT_SHORT_TAG}"'"/g' docs/source/conf.py -sed_runner 's/release = .*/release = "'"${NEXT_FULL_TAG}"'"/g' docs/source/conf.py - # Centralized version file update echo "${NEXT_FULL_TAG}" > VERSION diff --git a/docs/source/conf.py b/docs/source/conf.py index 9171bc9cc..a7d832627 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,6 +21,9 @@ # import os import sys +from packaging.version import Version + +import cucim sys.path.insert(0, os.path.abspath("../..")) curpath = os.path.dirname(__file__) @@ -71,10 +74,11 @@ # |version| and |release|, also used in various other places throughout the # built documents. # +CUCIM_VERSION = Version(cucim.__version__) # The short X.Y version. -version = "24.04" +version = f"{CUCIM_VERSION.major:02}.{CUCIM_VERSION.minor:02}" # The full version, including alpha/beta/rc tags. -release = "24.04.00" +release = f"{CUCIM_VERSION.major:02}.{CUCIM_VERSION.minor:02}.{CUCIM_VERSION.micro:02}" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.