From c995039eb854bb270e4ad54b4c4bf843191c9ce9 Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Tue, 5 Mar 2024 17:13:38 -0500
Subject: [PATCH 1/8] Remove hard-coding of RAPIDS version where possible

Issue: https://github.com/rapidsai/build-planning/issues/15
---
 build.sh                                      |  2 +-
 ci/build_docs.sh                              |  3 +-
 ci/release/update-version.sh                  | 31 -----------------
 cpp/CMakeLists.txt                            |  6 ++--
 cpp/doxygen/Doxyfile                          |  2 +-
 cpp/libcugraph_etl/CMakeLists.txt             |  4 +--
 docs/cugraph/source/conf.py                   |  9 +++--
 fetch_rapids.cmake                            | 19 -----------
 python/cugraph/CMakeLists.txt                 |  8 ++---
 python/nx-cugraph/_nx_cugraph/__init__.py     | 11 +++---
 .../{nx_cugraph => _nx_cugraph}/_version.py   |  0
 python/nx-cugraph/nx_cugraph/__init__.py      |  4 +--
 python/pylibcugraph/CMakeLists.txt            |  8 ++---
 rapids_config.cmake                           | 34 +++++++++++++++++++
 14 files changed, 65 insertions(+), 76 deletions(-)
 delete mode 100644 fetch_rapids.cmake
 rename python/nx-cugraph/{nx_cugraph => _nx_cugraph}/_version.py (100%)
 create mode 100644 rapids_config.cmake

diff --git a/build.sh b/build.sh
index 5cfd2b5af1c..d68ef0a8393 100755
--- a/build.sh
+++ b/build.sh
@@ -18,7 +18,7 @@ ARGS=$*
 # script, and that this script resides in the repo dir!
 REPODIR=$(cd $(dirname $0); pwd)
 
-RAPIDS_VERSION=24.04
+RAPIDS_VERSION="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2})/\1.\2/' VERSION)"
 
 # Valid args to this script (all possible targets and options) - only one per line
 VALIDARGS="
diff --git a/ci/build_docs.sh b/ci/build_docs.sh
index 298a8b68791..3045f98695c 100755
--- a/ci/build_docs.sh
+++ b/ci/build_docs.sh
@@ -39,7 +39,8 @@ rapids-mamba-retry install \
 rapids-logger "Install cugraph-dgl"
 rapids-mamba-retry install "${PYTHON_CHANNEL}/linux-64/cugraph-dgl-*.tar.bz2"
 
-export RAPIDS_VERSION_NUMBER="24.04"
+export RAPIDS_VERSION_NUMBER="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2})/\1.\2/' VERSION)"
+export RAPIDS_VERSION="$RAPIDS_VERSION_NUMBER"
 export RAPIDS_DOCS_DIR="$(mktemp -d)"
 
 for PROJECT in libcugraphops libwholegraph; do
diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh
index 9e284f49b5b..ce2c14a01fc 100755
--- a/ci/release/update-version.sh
+++ b/ci/release/update-version.sh
@@ -39,33 +39,11 @@ function sed_runner() {
     sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
 }
 
-# rapids-cmake version
-sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' fetch_rapids.cmake
-
-# CMakeLists update
-sed_runner 's/'"CUGRAPH VERSION .* LANGUAGES C CXX CUDA)"'/'"CUGRAPH VERSION ${NEXT_FULL_TAG} LANGUAGES C CXX CUDA)"'/g' cpp/CMakeLists.txt
-sed_runner 's|'"branch-.*/RAPIDS.cmake"'|'"branch-${NEXT_SHORT_TAG}/RAPIDS.cmake"'|g' cpp/CMakeLists.txt
-sed_runner 's/'"CUGRAPH_ETL VERSION .* LANGUAGES C CXX CUDA)"'/'"CUGRAPH_ETL VERSION ${NEXT_FULL_TAG} LANGUAGES C CXX CUDA)"'/g' cpp/libcugraph_etl/CMakeLists.txt
-sed_runner 's|'"branch-.*/RAPIDS.cmake"'|'"branch-${NEXT_SHORT_TAG}/RAPIDS.cmake"'|g' cpp/libcugraph_etl/CMakeLists.txt
-sed_runner "s/set(pylibcugraph_version .*)/set(pylibcugraph_version ${NEXT_FULL_TAG})/g" python/pylibcugraph/CMakeLists.txt
-sed_runner "s/set(cugraph_version .*)/set(cugraph_version ${NEXT_FULL_TAG})/g" python/cugraph/CMakeLists.txt
-
-# RTD update
-sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/cugraph/source/conf.py
-sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/cugraph/source/conf.py
-
-
-# build.sh script
-sed_runner 's/RAPIDS_VERSION=.*/RAPIDS_VERSION='${NEXT_SHORT_TAG}'/g' build.sh
-
 # Centralized version file update
 # NOTE: Any script that runs in CI will need to use gha-tool `rapids-generate-version`
 # and echo it to `VERSION` file to get an alpha spec of the current version
 echo "${NEXT_FULL_TAG}" > VERSION
 
-# Wheel testing script
-sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" ci/test_wheel_cugraph.sh
-
 # Need to distutils-normalize the original version
 NEXT_SHORT_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_SHORT_TAG}'))")
 
@@ -105,19 +83,11 @@ for DEP in "${DEPENDENCIES[@]}"; do
   done
 done
 
-# Doxyfile update
-sed_runner "s|PROJECT_NUMBER[[:space:]]*=.*|PROJECT_NUMBER=${NEXT_SHORT_TAG}|" cpp/doxygen/Doxyfile
-
 # ucx-py version
 sed_runner "/^ucx_py_version:$/ {n;s/.*/  - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/cugraph/conda_build_config.yaml
 sed_runner "/^ucx_py_version:$/ {n;s/.*/  - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/cugraph-service/conda_build_config.yaml
 sed_runner "/^ucx_py_version:$/ {n;s/.*/  - \"${NEXT_UCX_PY_VERSION}.*\"/}" conda/recipes/pylibcugraph/conda_build_config.yaml
 
-# nx-cugraph NetworkX entry-point meta-data
-sed_runner "s@branch-[0-9][0-9].[0-9][0-9]@branch-${NEXT_SHORT_TAG}@g" python/nx-cugraph/_nx_cugraph/__init__.py
-# FIXME: can this use the standard VERSION file and update mechanism?
-sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/nx-cugraph/_nx_cugraph/__init__.py
-
 # CI files
 for FILE in .github/workflows/*.yaml; do
   sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
@@ -126,7 +96,6 @@ for FILE in .github/workflows/*.yaml; do
   # Wheel builds install dask-cuda from source, update its branch
   sed_runner "s/dask-cuda.git@branch-[0-9][0-9].[0-9][0-9]/dask-cuda.git@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
 done
-sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TAG}\"/g" ci/build_docs.sh
 
 sed_runner "s/branch-.*/branch-${NEXT_SHORT_TAG}/g" python/nx-cugraph/README.md
 
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index c812cd8e4b3..17d5665cae7 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -16,7 +16,7 @@
 
 cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
 
-include(../fetch_rapids.cmake)
+include(../rapids_config.cmake)
 include(rapids-cmake)
 include(rapids-cpm)
 include(rapids-cuda)
@@ -25,7 +25,7 @@ include(rapids-find)
 
 rapids_cuda_init_architectures(CUGRAPH)
 
-project(CUGRAPH VERSION 24.04.00 LANGUAGES C CXX CUDA)
+project(CUGRAPH VERSION "${RAPIDS_VERSION}" LANGUAGES C CXX CUDA)
 
 if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
    CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
@@ -583,7 +583,7 @@ find_package(Doxygen 1.8.11)
 if(Doxygen_FOUND)
     add_custom_command(OUTPUT CUGRAPH_DOXYGEN
                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen
-                       COMMAND doxygen Doxyfile
+                       COMMAND ${CMAKE_COMMAND} -E env "RAPIDS_VERSION=${RAPIDS_VERSION}" doxygen Doxyfile
                        VERBATIM)
 
     add_custom_target(docs_cugraph DEPENDS CUGRAPH_DOXYGEN)
diff --git a/cpp/doxygen/Doxyfile b/cpp/doxygen/Doxyfile
index d4652a79f91..5b0f2ec0a5e 100644
--- a/cpp/doxygen/Doxyfile
+++ b/cpp/doxygen/Doxyfile
@@ -48,7 +48,7 @@ PROJECT_NAME           = libcugraph
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER=24.04
+PROJECT_NUMBER=$(RAPIDS_VERSION_MAJOR_MINOR)
 
 # 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
diff --git a/cpp/libcugraph_etl/CMakeLists.txt b/cpp/libcugraph_etl/CMakeLists.txt
index c1b526fb121..6b258afdf96 100644
--- a/cpp/libcugraph_etl/CMakeLists.txt
+++ b/cpp/libcugraph_etl/CMakeLists.txt
@@ -15,7 +15,7 @@
 #=============================================================================
 
 cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
-include(../../fetch_rapids.cmake)
+include(../../rapids_config.cmake)
 
 include(rapids-cmake)
 include(rapids-cpm)
@@ -25,7 +25,7 @@ include(rapids-find)
 
 rapids_cuda_init_architectures(CUGRAPH_ETL)
 
-project(CUGRAPH_ETL VERSION 24.04.00 LANGUAGES C CXX CUDA)
+project(CUGRAPH_ETL VERSION "${RAPIDS_VERSION}" LANGUAGES C CXX CUDA)
 
 if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
    CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
diff --git a/docs/cugraph/source/conf.py b/docs/cugraph/source/conf.py
index 719f94d4838..952b962aca2 100644
--- a/docs/cugraph/source/conf.py
+++ b/docs/cugraph/source/conf.py
@@ -19,6 +19,10 @@
 import os
 import sys
 
+from packaging.version import Version
+
+import cugraph
+
 # If extensions (or modules to document with autodoc) are in another
 # directory, add these directories to sys.path here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it
@@ -76,10 +80,11 @@
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
+CUGRAPH_VERSION = Version(cugraph.__version__)
 # The short X.Y version.
-version = '24.04'
+version = f"{CUGRAPH_VERSION.major:02}.{CUGRAPH_VERSION.minor:02}"
 # The full version, including alpha/beta/rc tags.
-release = '24.04.00'
+release = f"{CUGRAPH_VERSION.major:02}.{CUGRAPH_VERSION.minor:02}.{CUGRAPH_VERSION.micro:02}"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake
deleted file mode 100644
index 596908d01cd..00000000000
--- a/fetch_rapids.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-# =============================================================================
-# Copyright (c) 2022-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.
-# =============================================================================
-if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS.cmake)
-  file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.04/RAPIDS.cmake
-       ${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS.cmake
-  )
-endif()
-include(${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS.cmake)
diff --git a/python/cugraph/CMakeLists.txt b/python/cugraph/CMakeLists.txt
index 79510f9bf8d..dfccf02d042 100644
--- a/python/cugraph/CMakeLists.txt
+++ b/python/cugraph/CMakeLists.txt
@@ -14,9 +14,7 @@
 
 cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
 
-set(cugraph_version 24.04.00)
-
-include(../../fetch_rapids.cmake)
+include(../../rapids_config.cmake)
 
 # We always need CUDA for cuML because the raft dependency brings in a
 # header-only cuco dependency that enables CUDA unconditionally.
@@ -25,7 +23,7 @@ rapids_cuda_init_architectures(cugraph-python)
 
 project(
   cugraph-python
-  VERSION ${cugraph_version}
+  VERSION "${RAPIDS_VERSION}"
   LANGUAGES CXX CUDA
 )
 
@@ -43,7 +41,7 @@ endif()
 
 # If the user requested it,  we attempt to find CUGRAPH.
 if(FIND_CUGRAPH_CPP)
-  find_package(cugraph ${cugraph_version} REQUIRED)
+  find_package(cugraph "${RAPIDS_VERSION}" REQUIRED)
 else()
   set(cugraph_FOUND OFF)
 endif()
diff --git a/python/nx-cugraph/_nx_cugraph/__init__.py b/python/nx-cugraph/_nx_cugraph/__init__.py
index c6c43110ac6..26ac7a0eebd 100644
--- a/python/nx-cugraph/_nx_cugraph/__init__.py
+++ b/python/nx-cugraph/_nx_cugraph/__init__.py
@@ -23,12 +23,18 @@
 $ python _nx_cugraph/__init__.py
 """
 
+from packaging.version import Version
+
+from _nx_cugraph._version import __version__
+
+_nx_cugraph_version = Version(__version__)
+
 # Entries between BEGIN and END are automatically generated
 _info = {
     "backend_name": "cugraph",
     "project": "nx-cugraph",
     "package": "nx_cugraph",
-    "url": "https://github.com/rapidsai/cugraph/tree/branch-24.04/python/nx-cugraph",
+    "url": f"https://github.com/rapidsai/cugraph/tree/branch-{_nx_cugraph_version.major:02}.{_nx_cugraph_version.minor:02}/python/nx-cugraph",
     "short_summary": "GPU-accelerated backend.",
     # "description": "TODO",
     "functions": {
@@ -201,9 +207,6 @@ def get_info():
     return d
 
 
-# FIXME: can this use the standard VERSION file and update mechanism?
-__version__ = "24.04.00"
-
 if __name__ == "__main__":
     from pathlib import Path
 
diff --git a/python/nx-cugraph/nx_cugraph/_version.py b/python/nx-cugraph/_nx_cugraph/_version.py
similarity index 100%
rename from python/nx-cugraph/nx_cugraph/_version.py
rename to python/nx-cugraph/_nx_cugraph/_version.py
diff --git a/python/nx-cugraph/nx_cugraph/__init__.py b/python/nx-cugraph/nx_cugraph/__init__.py
index 3a8f0996e9c..2c54da87898 100644
--- a/python/nx-cugraph/nx_cugraph/__init__.py
+++ b/python/nx-cugraph/nx_cugraph/__init__.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2023, NVIDIA CORPORATION.
+# Copyright (c) 2023-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
@@ -29,4 +29,4 @@
 from . import algorithms
 from .algorithms import *
 
-from nx_cugraph._version import __git_commit__, __version__
+from _nx_cugraph._version import __git_commit__, __version__
diff --git a/python/pylibcugraph/CMakeLists.txt b/python/pylibcugraph/CMakeLists.txt
index cc76ab5ba2b..f43b7db1279 100644
--- a/python/pylibcugraph/CMakeLists.txt
+++ b/python/pylibcugraph/CMakeLists.txt
@@ -14,9 +14,7 @@
 
 cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)
 
-set(pylibcugraph_version 24.04.00)
-
-include(../../fetch_rapids.cmake)
+include(../../rapids_config.cmake)
 
 # We always need CUDA for cuML because the raft dependency brings in a
 # header-only cuco dependency that enables CUDA unconditionally.
@@ -25,7 +23,7 @@ rapids_cuda_init_architectures(pylibcugraph-python)
 
 project(
   pylibcugraph-python
-  VERSION ${pylibcugraph_version}
+  VERSION "${RAPIDS_VERSION}"
   LANGUAGES CXX CUDA
 )
 
@@ -43,7 +41,7 @@ endif()
 
 # If the user requested it we attempt to find CUGRAPH.
 if(FIND_CUGRAPH_CPP)
-  find_package(cugraph ${pylibcugraph_version} REQUIRED)
+  find_package(cugraph "${RAPIDS_VERSION}" REQUIRED)
 else()
   set(cugraph_FOUND OFF)
 endif()
diff --git a/rapids_config.cmake b/rapids_config.cmake
new file mode 100644
index 00000000000..50b1054b7b9
--- /dev/null
+++ b/rapids_config.cmake
@@ -0,0 +1,34 @@
+# =============================================================================
+# Copyright (c) 2018-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.
+# =============================================================================
+file(READ "${CMAKE_CURRENT_LIST_DIR}/VERSION" _rapids_version)
+if(_rapids_version MATCHES [[^([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9])]])
+  set(RAPIDS_VERSION_MAJOR "${CMAKE_MATCH_1}")
+  set(RAPIDS_VERSION_MINOR "${CMAKE_MATCH_2}")
+  set(RAPIDS_VERSION_PATCH "${CMAKE_MATCH_3}")
+  set(RAPIDS_VERSION_MAJOR_MINOR "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}")
+  set(RAPIDS_VERSION "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}.${RAPIDS_VERSION_PATCH}")
+else()
+  string(REPLACE "\n" "\n  " _rapids_version_formatted "  ${_rapids_version}")
+  message(
+    FATAL_ERROR
+      "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}")
+endif()
+
+if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake")
+  file(
+    DOWNLOAD
+    "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/RAPIDS.cmake"
+    "${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake")
+endif()
+include("${CMAKE_CURRENT_BINARY_DIR}/CUGRAPH_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake")

From cc9eb6cf204cba73abc292fc6e542a4c98f257bd Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Wed, 6 Mar 2024 11:53:40 -0500
Subject: [PATCH 2/8] Properly update _nx_cugraph/_version.py

---
 ci/build_python.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ci/build_python.sh b/ci/build_python.sh
index 07a4f59396b..62154fdeced 100755
--- a/ci/build_python.sh
+++ b/ci/build_python.sh
@@ -23,10 +23,11 @@ echo "${version}" > VERSION
 rapids-logger "Begin py build"
 
 package_dir="python"
-for package_name in pylibcugraph cugraph nx-cugraph cugraph-pyg cugraph-dgl; do
+for package_name in pylibcugraph cugraph cugraph-pyg cugraph-dgl; do
   underscore_package_name=$(echo "${package_name}" | tr "-" "_")
   sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/${package_name}/${underscore_package_name}/_version.py"
 done
+sed -i "/^__git_commit__/ s/= .*/= \"${git_commit}\"/g" "${package_dir}/nx-cugraph/_nx_cugraph/_version.py"
 
 # TODO: Remove `--no-test` flags once importing on a CPU
 # node works correctly

From 3693c627ac494dd753b8c37eeb8924dd59cc0843 Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Wed, 6 Mar 2024 12:45:37 -0500
Subject: [PATCH 3/8] Use _nx_cugraph in build_wheel.sh

---
 ci/build_wheel.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh
index 30a1c98c106..4cfdc57a814 100755
--- a/ci/build_wheel.sh
+++ b/ci/build_wheel.sh
@@ -20,8 +20,12 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
 PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"
 
 # Patch project metadata files to include the CUDA version suffix and version override.
+version_package_name="$underscore_package_name"
+if [[ version_package_name = "nx_cugraph" ]]; then
+    version_package_name="_nx_cugraph"
+fi
 pyproject_file="${package_dir}/pyproject.toml"
-version_file="${package_dir}/${underscore_package_name}/_version.py"
+version_file="${package_dir}/${version_package_name}/_version.py"
 
 sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
 echo "${version}" > VERSION

From 3a3c17c21882043d9ee2f2f446b5bf358aeda54e Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Wed, 6 Mar 2024 14:08:32 -0500
Subject: [PATCH 4/8] Fix build_wheel.sh

---
 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 4cfdc57a814..bba22788fab 100755
--- a/ci/build_wheel.sh
+++ b/ci/build_wheel.sh
@@ -21,7 +21,7 @@ PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"
 
 # Patch project metadata files to include the CUDA version suffix and version override.
 version_package_name="$underscore_package_name"
-if [[ version_package_name = "nx_cugraph" ]]; then
+if [[ "${version_package_name}" = "nx_cugraph" ]]; then
     version_package_name="_nx_cugraph"
 fi
 pyproject_file="${package_dir}/pyproject.toml"

From 4a449e96d7c7d9aeacae8574c13bb9f7ca8e44b1 Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Thu, 7 Mar 2024 10:28:18 -0500
Subject: [PATCH 5/8] Use new gha-tools version tools, fix Doxygen build

---
 ci/build_docs.sh   | 5 +++--
 cpp/CMakeLists.txt | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ci/build_docs.sh b/ci/build_docs.sh
index 3045f98695c..8e7cfc2c4b8 100755
--- a/ci/build_docs.sh
+++ b/ci/build_docs.sh
@@ -39,8 +39,9 @@ rapids-mamba-retry install \
 rapids-logger "Install cugraph-dgl"
 rapids-mamba-retry install "${PYTHON_CHANNEL}/linux-64/cugraph-dgl-*.tar.bz2"
 
-export RAPIDS_VERSION_NUMBER="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2})/\1.\2/' VERSION)"
-export RAPIDS_VERSION="$RAPIDS_VERSION_NUMBER"
+export RAPIDS_VERSION="$(rapids-version)"
+export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
+export RAPIDS_VERSION_NUMBER="$RAPIDS_VERSION_MAJOR_MINOR"
 export RAPIDS_DOCS_DIR="$(mktemp -d)"
 
 for PROJECT in libcugraphops libwholegraph; do
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index ee5ae679b0c..241cb17804d 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -584,7 +584,7 @@ find_package(Doxygen 1.8.11)
 if(Doxygen_FOUND)
     add_custom_command(OUTPUT CUGRAPH_DOXYGEN
                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen
-                       COMMAND ${CMAKE_COMMAND} -E env "RAPIDS_VERSION=${RAPIDS_VERSION}" doxygen Doxyfile
+                       COMMAND ${CMAKE_COMMAND} -E env "RAPIDS_VERSION_MAJOR_MINOR=${RAPIDS_VERSION_MAJOR_MINOR}" doxygen Doxyfile
                        VERBATIM)
 
     add_custom_target(docs_cugraph DEPENDS CUGRAPH_DOXYGEN)

From e2fa70ff08dc7ff5b7c71d9416e0bbdd5f05c1d5 Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Thu, 7 Mar 2024 10:29:29 -0500
Subject: [PATCH 6/8] Fix build.sh

---
 build.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build.sh b/build.sh
index d68ef0a8393..bd716943216 100755
--- a/build.sh
+++ b/build.sh
@@ -18,7 +18,7 @@ ARGS=$*
 # script, and that this script resides in the repo dir!
 REPODIR=$(cd $(dirname $0); pwd)
 
-RAPIDS_VERSION="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2})/\1.\2/' VERSION)"
+RAPIDS_VERSION="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2}).*$/\1.\2/' VERSION)"
 
 # Valid args to this script (all possible targets and options) - only one per line
 VALIDARGS="

From 3470e0b93722ad109cd9f9a43677a272bb25ecbe Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Wed, 13 Mar 2024 11:57:49 -0400
Subject: [PATCH 7/8] Fix nx-cugraph handling of VERSION

---
 python/nx-cugraph/{nx_cugraph => _nx_cugraph}/VERSION | 0
 python/nx-cugraph/_nx_cugraph/_version.py             | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename python/nx-cugraph/{nx_cugraph => _nx_cugraph}/VERSION (100%)

diff --git a/python/nx-cugraph/nx_cugraph/VERSION b/python/nx-cugraph/_nx_cugraph/VERSION
similarity index 100%
rename from python/nx-cugraph/nx_cugraph/VERSION
rename to python/nx-cugraph/_nx_cugraph/VERSION
diff --git a/python/nx-cugraph/_nx_cugraph/_version.py b/python/nx-cugraph/_nx_cugraph/_version.py
index a528a3bfe1b..dc2d2a3a3c0 100644
--- a/python/nx-cugraph/_nx_cugraph/_version.py
+++ b/python/nx-cugraph/_nx_cugraph/_version.py
@@ -19,6 +19,6 @@
 # to update version info (including commit hashes) without modifying
 # source files.
 __version__ = (
-    importlib.resources.files("nx_cugraph").joinpath("VERSION").read_text().strip()
+    importlib.resources.files("_nx_cugraph").joinpath("VERSION").read_text().strip()
 )
 __git_commit__ = ""

From d473153512e74be42d6ab0b0d93c7ed85a1d00a8 Mon Sep 17 00:00:00 2001
From: Kyle Edwards <kyedwards@nvidia.com>
Date: Wed, 13 Mar 2024 12:20:30 -0400
Subject: [PATCH 8/8] Fix VERSION in nx-cugraph/pyproject.toml

---
 python/nx-cugraph/pyproject.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/nx-cugraph/pyproject.toml b/python/nx-cugraph/pyproject.toml
index 07ec0eab264..0ae83b653ba 100644
--- a/python/nx-cugraph/pyproject.toml
+++ b/python/nx-cugraph/pyproject.toml
@@ -71,7 +71,7 @@ cugraph = "_nx_cugraph:get_info"
 license-files = ["LICENSE"]
 
 [tool.setuptools.dynamic]
-version = {file = "nx_cugraph/VERSION"}
+version = {file = "_nx_cugraph/VERSION"}
 
 [tool.setuptools.packages.find]
 include = [