From 1e718e70cab13a098323e6e019f1c833a25100c5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Wed, 20 Aug 2025 15:03:44 -0500 Subject: [PATCH 01/14] update cmake --- cmake/rapids_config.cmake | 15 +++++++++++++++ cpp/CMakeLists.txt | 6 +++--- cpp/libmps_parser/CMakeLists.txt | 2 +- python/cuopt/CMakeLists.txt | 8 +++----- .../cuopt/cuopt/linear_programming/CMakeLists.txt | 6 ++---- python/libcuopt/CMakeLists.txt | 6 ++---- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/cmake/rapids_config.cmake b/cmake/rapids_config.cmake index 9b361d59fc..898680fe26 100644 --- a/cmake/rapids_config.cmake +++ b/cmake/rapids_config.cmake @@ -28,3 +28,18 @@ endif() set(rapids-cmake-version "${RAPIDS_VERSION_MAJOR_MINOR}") include("${CMAKE_CURRENT_LIST_DIR}/RAPIDS.cmake") + +file(READ "${CMAKE_CURRENT_LIST_DIR}/../VERSION" _cuopt_version) +if(_cuopt_version MATCHES [[^([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9])]]) + set(CUOPT_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CUOPT_VERSION_MINOR "${CMAKE_MATCH_2}") + set(CUOPT_VERSION_PATCH "${CMAKE_MATCH_3}") + set(CUOPT_VERSION_MAJOR_MINOR "${CUOPT_VERSION_MAJOR}.${CUOPT_VERSION_MINOR}") + set(CUOPT_VERSION "${CUOPT_VERSION_MAJOR}.${CUOPT_VERSION_MINOR}.${CUOPT_VERSION_PATCH}") +else() + string(REPLACE "\n" "\n " _cuopt_version_formatted " ${_cuopt_version}") + message( + FATAL_ERROR + "Could not determine cuOpt version. Contents of VERSION file:\n${_cuopt_version_formatted}" + ) +endif() diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 53071afaed..9c81b7b7ec 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -32,12 +32,12 @@ rapids_cuda_init_architectures(CUOPT) project( CUOPT - VERSION 25.10.00 + VERSION "${CUOPT_VERSION}" LANGUAGES CXX CUDA C ) -set(DEPENDENT_LIB_MAJOR_VERSION "25") -set(DEPENDENT_LIB_MINOR_VERSION "10") +set(DEPENDENT_LIB_MAJOR_VERSION "${RAPIDS_VERSION_MAJOR}") +set(DEPENDENT_LIB_MINOR_VERSION "${RAPIDS_VERSION_MINOR}") rapids_cmake_write_version_file(include/cuopt/version_config.hpp) # ################################################################################################## diff --git a/cpp/libmps_parser/CMakeLists.txt b/cpp/libmps_parser/CMakeLists.txt index d6b87f03fa..33f0a7b581 100644 --- a/cpp/libmps_parser/CMakeLists.txt +++ b/cpp/libmps_parser/CMakeLists.txt @@ -22,7 +22,7 @@ include(rapids-find) project( MPS_PARSER - VERSION 25.10.00 + VERSION "${CUOPT_VERSION}" LANGUAGES CXX ) diff --git a/python/cuopt/CMakeLists.txt b/python/cuopt/CMakeLists.txt index 097082d709..a6ae668e7d 100644 --- a/python/cuopt/CMakeLists.txt +++ b/python/cuopt/CMakeLists.txt @@ -15,15 +15,13 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuopt_version 25.10.00) - include(../../cmake/rapids_config.cmake) include(rapids-cuda) rapids_cuda_init_architectures(CUOPT) project( cuopt-python - VERSION ${cuopt_version} + VERSION "${CUOPT_VERSION}" LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C # language to be enabled here. The test project that is built in scikit-build to verify # various linking options for the python library is hardcoded to build with C, so until @@ -31,8 +29,8 @@ project( C CXX CUDA) -find_package(cuopt ${cuopt_version}) -find_package(mps_parser ${cuopt_version}) +find_package(cuopt "${CUOPT_VERSION}") +find_package(mps_parser "${CUOPT_VERSION}") include(rapids-cython-core) rapids_cython_init() diff --git a/python/cuopt/cuopt/linear_programming/CMakeLists.txt b/python/cuopt/cuopt/linear_programming/CMakeLists.txt index c31ed89bef..1f46f31826 100644 --- a/python/cuopt/cuopt/linear_programming/CMakeLists.txt +++ b/python/cuopt/cuopt/linear_programming/CMakeLists.txt @@ -15,13 +15,11 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuopt_version 25.10.00) - include(../../../../cmake/rapids_config.cmake) project( mpsparser-python - VERSION ${cuopt_version} + VERSION "${CUOPT_VERSION}" LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C # language to be enabled here. The test project that is built in scikit-build to verify # various linking options for the python library is hardcoded to build with C, so until @@ -34,7 +32,7 @@ option(CUOPT_BUILD_WHEELS "Whether this build is generating a Python wheel." ON) # If the user requested it we attempt to find MPS Parser. if(FIND_MPS_PARSER_CPP) - find_package(mps_parser ${cuopt_version}) + find_package(mps_parser "${CUOPT_VERSION}") else() set(mps_parser_FOUND OFF) endif() diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt index b997708876..85b7c98513 100644 --- a/python/libcuopt/CMakeLists.txt +++ b/python/libcuopt/CMakeLists.txt @@ -15,21 +15,19 @@ cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR) -set(cuopt_version 25.10.00) - include(../../cmake/rapids_config.cmake) include(rapids-cuda) rapids_cuda_init_architectures(libcuopt-python) project( libcuopt-python - VERSION "${cuopt_version}" + VERSION "${CUOPT_VERSION}" LANGUAGES CXX CUDA ) # Check if cuopt is already available. If so, it is the user's responsibility to ensure that the # CMake package is also available at build time of the Python cuopt package. -find_package(cuopt "${cuopt_version}") +find_package(cuopt "${CUOPT_VERSION}") if(cuopt_FOUND) return() From 63177913260c9451bb67beecfa6674b2fc9c398f Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 11:41:07 -0500 Subject: [PATCH 02/14] fix doxy file --- ci/build_docs.sh | 3 +++ cpp/doxygen/Doxyfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 3089358c97..127e390034 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -22,6 +22,9 @@ rapids-logger "Create test conda environment" ENV_YAML_DIR="$(mktemp -d)" +CUOPT_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)" +export CUOPT_VERSION_MAJOR_MINOR + rapids-logger "Downloading artifacts from previous jobs" CPP_CHANNEL=$(rapids-download-conda-from-github cpp) PYTHON_CHANNEL=$(rapids-download-conda-from-github python) diff --git a/cpp/doxygen/Doxyfile b/cpp/doxygen/Doxyfile index 12ae21c19a..cf86936a9c 100644 --- a/cpp/doxygen/Doxyfile +++ b/cpp/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "libcuopt" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 25.10 +PROJECT_NUMBER = "$(CUOPT_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 From 199ca6466eda46cfad316544db65f7de52455206 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 11:41:54 -0500 Subject: [PATCH 03/14] use cuopt__version for py files --- python/cuopt_server/cuopt_server/utils/data_definition.py | 2 +- .../cuopt_server/utils/linear_programming/data_definition.py | 3 ++- .../cuopt_server/cuopt_server/utils/routing/data_definition.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index 4d4df04346..b5d44da8be 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -343,7 +343,7 @@ class LogResponseModel(StrictModel): "application/json": { "examples": { "Healthy response": { - "value": {"status": "RUNNING", "version": "25.10"} + "value": {"status": "RUNNING", "version": ".".join(cuopt.__version__.split(".")[:2])} } } } diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py index 5c5ee7e6ee..0af2589082 100644 --- a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py @@ -15,6 +15,7 @@ import copy import json +import cuopt from typing import Dict, List, Literal, Optional, Tuple, Union import jsonref @@ -853,7 +854,7 @@ class IncumbentSolution(StrictModel): managed_lp_example_data = { "action": "cuOpt_LP", "data": lp_example_data, - "client_version": "25.10", + "client_version": ".".join(cuopt.__version__.split(".")[:2]), } # cut and pasted from actual run of LP example data. diff --git a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py index 03bc63f1ef..c2cf9b66bc 100644 --- a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py @@ -15,6 +15,7 @@ import copy import json +import cuopt from enum import Enum from typing import Dict, List, Optional, Union @@ -1026,7 +1027,7 @@ class InFeasibleSolve(StrictModel): managed_vrp_example_data = { "action": "cuOpt_OptimizedRouting", "data": vrp_example_data, - "client_version": "25.10", + "client_version": ".".join(cuopt.__version__.split(".")[:2]), } # cut and pasted from actual run of VRP example data. From 3274eeaf727168916fe9718fba55b8198547d131 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 14:42:27 -0500 Subject: [PATCH 04/14] fix versions1 and add pre-commit --- .pre-commit-config.yaml | 7 ++ ci/utils/update_doc_versions.py | 93 +++++++++++++++++++ .../cuopt_server/utils/data_definition.py | 7 +- .../linear_programming/data_definition.py | 3 +- .../utils/routing/data_definition.py | 3 +- 5 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 ci/utils/update_doc_versions.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9e1abedc8..d5ac1c0ac7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,6 +97,13 @@ repos: (?x)^( ^cpp/tests/utilities/cxxopts.hpp ) + - repo: local + hooks: + - id: update-versions + name: Update versions1.json + entry: python ci/utils/update_doc_versions.py + language: system + files: docs/cuopt/source/versions1.json default_language_version: diff --git a/ci/utils/update_doc_versions.py b/ci/utils/update_doc_versions.py new file mode 100644 index 0000000000..4ee6ed48b1 --- /dev/null +++ b/ci/utils/update_doc_versions.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# 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. + +""" +Script to update versions1.json with new version from VERSION file. +This script reads the current version from the VERSION file and adds it to versions1.json +if it doesn't already exist, setting it as the latest and preferred version. +""" + +import json +import os +import sys +from pathlib import Path + + + +def update_versions(version_file_path, versions_file_path): + """Update the versions list with the new version.""" + # Read VERSION file + with open(version_file_path, 'r') as f: + version = f.read().strip() + if not version: + raise ValueError("VERSION file is empty") + + # Read versions1.json file + with open(versions_file_path, 'r') as f: + versions = json.load(f) + + # Check if version already exists + for version_entry in versions: + if version_entry.get("version") == version: + print(f"Version {version} already exists in versions1.json") + return False + + # Remove "latest" and "preferred" from existing entries + for version_entry in versions: + if version_entry.get("name") == "latest": + version_entry.pop("name", None) + if version_entry.get("preferred"): + version_entry.pop("preferred", None) + + # Create new entry for the current version + new_entry = { + "version": version, + "url": f"../{version}/", + "name": "latest", + "preferred": True + } + + # Add new entry at the beginning (most recent first) + versions.insert(0, new_entry) + + # Write updated versions back to file + with open(versions_file_path, 'w') as f: + json.dump(versions, f, indent=2) + + return True + + +def main(): + """Main function to update versions1.json.""" + # Get the repository root directory (assuming script is run from repo root) + repo_root = Path.cwd() + + # Hard-coded file paths + version_file_path = repo_root / "VERSION" + versions_file_path = repo_root / "docs" / "cuopt" / "source" / "versions1.json" + + # Update versions + was_updated = update_versions(version_file_path, versions_file_path) + + if was_updated: + print("Version update completed successfully!") + else: + print("No update needed - version already exists") + + +if __name__ == "__main__": + main() diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index b5d44da8be..1abd6aff04 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -343,7 +343,12 @@ class LogResponseModel(StrictModel): "application/json": { "examples": { "Healthy response": { - "value": {"status": "RUNNING", "version": ".".join(cuopt.__version__.split(".")[:2])} + "value": { + "status": "RUNNING", + "version": ".".join( + cuopt.__version__.split(".")[:2] + ), + } } } } diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py index 0af2589082..c549cf0a38 100644 --- a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py @@ -15,7 +15,6 @@ import copy import json -import cuopt from typing import Dict, List, Literal, Optional, Tuple, Union import jsonref @@ -23,6 +22,8 @@ from pydantic import BaseModel, Extra, Field, PlainValidator from typing_extensions import Annotated +import cuopt + # INPUT DATA DEFINITIONS diff --git a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py index c2cf9b66bc..be29465a60 100644 --- a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py @@ -15,13 +15,14 @@ import copy import json -import cuopt from enum import Enum from typing import Dict, List, Optional, Union import jsonref from pydantic import BaseModel, Extra, Field, RootModel, root_validator +import cuopt + class LocationTypeEnum(str, Enum): Depot = "Depot" From 35397bb1de84838426dfad587c970dfd85da85e1 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 14:43:45 -0500 Subject: [PATCH 05/14] fix style --- ci/utils/update_doc_versions.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ci/utils/update_doc_versions.py b/ci/utils/update_doc_versions.py index 4ee6ed48b1..261824980c 100644 --- a/ci/utils/update_doc_versions.py +++ b/ci/utils/update_doc_versions.py @@ -27,47 +27,46 @@ from pathlib import Path - def update_versions(version_file_path, versions_file_path): """Update the versions list with the new version.""" # Read VERSION file - with open(version_file_path, 'r') as f: + with open(version_file_path, "r") as f: version = f.read().strip() if not version: raise ValueError("VERSION file is empty") - + # Read versions1.json file - with open(versions_file_path, 'r') as f: + with open(versions_file_path, "r") as f: versions = json.load(f) - + # Check if version already exists for version_entry in versions: if version_entry.get("version") == version: print(f"Version {version} already exists in versions1.json") return False - + # Remove "latest" and "preferred" from existing entries for version_entry in versions: if version_entry.get("name") == "latest": version_entry.pop("name", None) if version_entry.get("preferred"): version_entry.pop("preferred", None) - + # Create new entry for the current version new_entry = { "version": version, "url": f"../{version}/", "name": "latest", - "preferred": True + "preferred": True, } - + # Add new entry at the beginning (most recent first) versions.insert(0, new_entry) - + # Write updated versions back to file - with open(versions_file_path, 'w') as f: + with open(versions_file_path, "w") as f: json.dump(versions, f, indent=2) - + return True @@ -75,14 +74,16 @@ def main(): """Main function to update versions1.json.""" # Get the repository root directory (assuming script is run from repo root) repo_root = Path.cwd() - + # Hard-coded file paths version_file_path = repo_root / "VERSION" - versions_file_path = repo_root / "docs" / "cuopt" / "source" / "versions1.json" - + versions_file_path = ( + repo_root / "docs" / "cuopt" / "source" / "versions1.json" + ) + # Update versions was_updated = update_versions(version_file_path, versions_file_path) - + if was_updated: print("Version update completed successfully!") else: From 8fd32f9d13d66779eb257fc6236e571e548ac417 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 14:44:35 -0500 Subject: [PATCH 06/14] fix checks --- python/cuopt_server/cuopt_server/utils/data_definition.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index 1abd6aff04..28de68a4cd 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -23,6 +23,8 @@ import jsonref from pydantic import BaseModel, Extra, Field +import cuopt + from .linear_programming.data_definition import ( # noqa IncumbentSolution, LPData, From 67cc55dc1e0794e49d029ef3af0c5845c1404e46 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 14:58:05 -0500 Subject: [PATCH 07/14] remove unwanted changes --- ci/release/update-version.sh | 42 +----------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 3d5b1f2413..de8f2ce398 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -58,9 +58,6 @@ DEPENDENCIES=( for DEP in "${DEPENDENCIES[@]}"; do for FILE in dependencies.yaml conda/environments/*.yaml python/*/pyproject.toml; do - sed_runner "s/\(${DEP}==\)[0-9]\+\.[0-9]\+/\1${NEXT_SHORT_TAG_PEP440}/" "${FILE}" - done - for FILE in python/*/pyproject.toml; do sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}\(\[.*\]\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}" done for FILE in docs/cuopt/source/*/quick-start.rst README.md; do @@ -70,44 +67,10 @@ for DEP in "${DEPENDENCIES[@]}"; do done done -# CMakeLists update -sed_runner 's/'"VERSION [0-9][0-9].[0-9][0-9].[0-9][0-9]"'/'"VERSION ${NEXT_FULL_TAG}"'/g' cpp/CMakeLists.txt -sed_runner 's/'"VERSION [0-9][0-9].[0-9][0-9].[0-9][0-9]"'/'"VERSION ${NEXT_FULL_TAG}"'/g' cpp/libmps_parser/CMakeLists.txt -sed_runner 's/'"DEPENDENT_LIB_MAJOR_VERSION \"[0-9][0-9]\""'/'"DEPENDENT_LIB_MAJOR_VERSION \"${NEXT_MAJOR}\""'/g' cpp/CMakeLists.txt -sed_runner 's/'"DEPENDENT_LIB_MINOR_VERSION \"[0-9][0-9]\""'/'"DEPENDENT_LIB_MINOR_VERSION \"${NEXT_MINOR}\""'/g' cpp/CMakeLists.txt - -# Server version update -sed_runner 's/'"\"version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/data_definition.py -sed_runner 's/'"\"client_version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"client_version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/routing/data_definition.py -sed_runner 's/'"\"client_version\": \"[0-9][0-9].[0-9][0-9]\""'/'"\"client_version\": \"${NEXT_SHORT_TAG}\""'/g' python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py - -# Doc update -sed_runner 's/'"version = \"[0-9][0-9].[0-9][0-9]\""'/'"version = \"${NEXT_SHORT_TAG}\""'/g' docs/cuopt/source/conf.py -sed_runner 's/'"PROJECT_NUMBER = [0-9][0-9].[0-9][0-9]"'/'"PROJECT_NUMBER = ${NEXT_SHORT_TAG}"'/g' cpp/doxygen/Doxyfile - # Update project.json PROJECT_FILE="docs/cuopt/source/project.json" sed_runner 's/\("version": "\)[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]"/\1'${NEXT_FULL_TAG}'"/g' "${PROJECT_FILE}" -# Update VERSIONS.json -VERSIONS_FILE="docs/cuopt/source/versions1.json" -# Only update if NEXT_FULL_TAG is not already present -if ! grep -q "\"version\": \"${NEXT_FULL_TAG}\"" "${VERSIONS_FILE}"; then - # Remove preferred and latest flags, but keep the version entry and URL - sed_runner '/"name": "latest",/d' "${VERSIONS_FILE}" - sed_runner '/"preferred": true,\?/d' "${VERSIONS_FILE}" - # Remove trailing comma after "url": ... in all version entries - sed_runner 's/\("url": "[^"]*"\),/\1/' "${VERSIONS_FILE}" - # Add new version entry with both preferred and latest flags - NEW_VERSION_ENTRY=' {\n "version": "'${NEXT_FULL_TAG}'",\n "url": "../'${NEXT_FULL_TAG}'/",\n "name": "latest",\n "preferred": true\n },' - sed_runner "/\[/a\\${NEW_VERSION_ENTRY}" "${VERSIONS_FILE}" -fi - -# RTD update -sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/cuopt/CMakeLists.txt -sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/cuopt/cuopt/linear_programming/CMakeLists.txt -sed_runner "/^set(cuopt_version/ s/[0-9][0-9].[0-9][0-9].[0-9][0-9]/${NEXT_FULL_TAG}/g" python/libcuopt/CMakeLists.txt - # Update nightly sed_runner 's/'"cuopt_version: \"[0-9][0-9].[0-9][0-9]\""'/'"cuopt_version: \"${NEXT_SHORT_TAG}\""'/g' .github/workflows/nightly.yaml @@ -120,7 +83,4 @@ for FILE in .github/workflows/*.yaml; do sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}" # CI image tags of the form {rapids_version}-{something} sed_runner "s/:[0-9]*\\.[0-9]*-/:${NEXT_SHORT_TAG}-/g" "${FILE}" -done - -# PYTHON for RAPIDS -sed_runner "/DOWNLOAD.*rapids-cmake/ s/branch-[0-9][0-9].[0-9][0-9]/branch-${NEXT_SHORT_TAG}/g" python/cuopt/CMakeLists.txt +done \ No newline at end of file From 8ba979b5e0cf1abd79c1796d4640e58b01bfed6e Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 14:58:35 -0500 Subject: [PATCH 08/14] update version --- ci/release/update-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index de8f2ce398..c2ecaf9017 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -83,4 +83,4 @@ for FILE in .github/workflows/*.yaml; do sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}" # CI image tags of the form {rapids_version}-{something} sed_runner "s/:[0-9]*\\.[0-9]*-/:${NEXT_SHORT_TAG}-/g" "${FILE}" -done \ No newline at end of file +done From db9b5c6d82d28a89738dc32551d55e8ceb10dd07 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 15:07:00 -0500 Subject: [PATCH 09/14] fix versions --- ci/release/update-version.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index c2ecaf9017..ec9539634c 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -57,9 +57,12 @@ DEPENDENCIES=( ) for DEP in "${DEPENDENCIES[@]}"; do - for FILE in dependencies.yaml conda/environments/*.yaml python/*/pyproject.toml; do + for FILE in dependencies.yaml conda/environments/*.yaml; do sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}\(\[.*\]\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}" done + for FILE in python/*/pyproject.toml; do + sed_runner "/\"${DEP}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" "${FILE}" + done for FILE in docs/cuopt/source/*/quick-start.rst README.md; do sed_runner "s/\(${DEP}==\)[0-9]\+\.[0-9]\+\.\\*/\1${NEXT_SHORT_TAG_PEP440}.\*/g" "${FILE}" sed_runner "s/\(${DEP}=\)[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?[^ ]*/\1${NEXT_SHORT_TAG}.*/g" "${FILE}" From 456f33e65506b422e9efb31735a40de994b01d96 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Thu, 21 Aug 2025 15:13:02 -0500 Subject: [PATCH 10/14] update version --- ci/release/update-version.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index ec9539634c..2f0e4cc15b 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -64,9 +64,9 @@ for DEP in "${DEPENDENCIES[@]}"; do sed_runner "/\"${DEP}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" "${FILE}" done for FILE in docs/cuopt/source/*/quick-start.rst README.md; do - sed_runner "s/\(${DEP}==\)[0-9]\+\.[0-9]\+\.\\*/\1${NEXT_SHORT_TAG_PEP440}.\*/g" "${FILE}" - sed_runner "s/\(${DEP}=\)[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?[^ ]*/\1${NEXT_SHORT_TAG}.*/g" "${FILE}" - sed_runner "s/\(${DEP}:\)[0-9]\{2\}\.[0-9]\{1,2\}\.[0-9]\+\(-cuda[0-9]\+\.[0-9]\+-\)\(py[0-9]\+\)/\1${DOCKER_TAG}\2\3/g" "${FILE}" + sed_runner "/${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==[0-9]\+\.[0-9]\+\.\*/==${NEXT_SHORT_TAG_PEP440}.\*/g" "${FILE}" + sed_runner "/${DEP}=/ s/=[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?[^ ]*/=${NEXT_SHORT_TAG}.*/g" "${FILE}" + sed_runner "/${DEP}:/ s/:[0-9]\{2\}\.[0-9]\{1,2\}\.[0-9]\+\(-cuda[0-9]\+\.[0-9]\+-\)\(py[0-9]\+\)/:${DOCKER_TAG}\1\2/g" "${FILE}" done done From 062c71df5efbc44db0d12c0bf6e65ee1c6d3cff7 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 22 Aug 2025 10:22:54 -0500 Subject: [PATCH 11/14] address review changes --- ci/utils/update_doc_versions.py | 8 +------- python/cuopt/cuopt/__init__.py | 3 ++- python/cuopt/cuopt/_version.py | 2 ++ python/cuopt_server/cuopt_server/utils/data_definition.py | 6 ++---- .../utils/linear_programming/data_definition.py | 4 ++-- .../cuopt_server/utils/routing/data_definition.py | 4 ++-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ci/utils/update_doc_versions.py b/ci/utils/update_doc_versions.py index 261824980c..61e4935b34 100644 --- a/ci/utils/update_doc_versions.py +++ b/ci/utils/update_doc_versions.py @@ -82,13 +82,7 @@ def main(): ) # Update versions - was_updated = update_versions(version_file_path, versions_file_path) - - if was_updated: - print("Version update completed successfully!") - else: - print("No update needed - version already exists") - + update_versions(version_file_path, versions_file_path) if __name__ == "__main__": main() diff --git a/python/cuopt/cuopt/__init__.py b/python/cuopt/cuopt/__init__.py index c12a888281..5235bdb069 100644 --- a/python/cuopt/cuopt/__init__.py +++ b/python/cuopt/cuopt/__init__.py @@ -22,4 +22,5 @@ del libcuopt from cuopt import linear_programming, routing -from cuopt._version import __git_commit__, __version__ +from cuopt._version import __git_commit__, __version__, __version_major_minor__ + diff --git a/python/cuopt/cuopt/_version.py b/python/cuopt/cuopt/_version.py index 6d6f1fa097..a89da8a08d 100644 --- a/python/cuopt/cuopt/_version.py +++ b/python/cuopt/cuopt/_version.py @@ -19,3 +19,5 @@ importlib.resources.files("cuopt").joinpath("VERSION").read_text().strip() ) __git_commit__ = "" + +__version_major_minor__ = ".".join(__version__.split(".")[:2]) diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index 28de68a4cd..0e9424f07d 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -23,7 +23,7 @@ import jsonref from pydantic import BaseModel, Extra, Field -import cuopt +from cuopt import __version_major_minor__ from .linear_programming.data_definition import ( # noqa IncumbentSolution, @@ -347,9 +347,7 @@ class LogResponseModel(StrictModel): "Healthy response": { "value": { "status": "RUNNING", - "version": ".".join( - cuopt.__version__.split(".")[:2] - ), + "version": __version_major_minor__, } } } diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py index c549cf0a38..a0a63c3fcc 100644 --- a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py @@ -22,7 +22,7 @@ from pydantic import BaseModel, Extra, Field, PlainValidator from typing_extensions import Annotated -import cuopt +from cuopt import __version_major_minor__ # INPUT DATA DEFINITIONS @@ -855,7 +855,7 @@ class IncumbentSolution(StrictModel): managed_lp_example_data = { "action": "cuOpt_LP", "data": lp_example_data, - "client_version": ".".join(cuopt.__version__.split(".")[:2]), + "client_version": __version_major_minor__, } # cut and pasted from actual run of LP example data. diff --git a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py index be29465a60..b0f13cf252 100644 --- a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py @@ -21,7 +21,7 @@ import jsonref from pydantic import BaseModel, Extra, Field, RootModel, root_validator -import cuopt +from cuopt import __version_major_minor__ class LocationTypeEnum(str, Enum): @@ -1028,7 +1028,7 @@ class InFeasibleSolve(StrictModel): managed_vrp_example_data = { "action": "cuOpt_OptimizedRouting", "data": vrp_example_data, - "client_version": ".".join(cuopt.__version__.split(".")[:2]), + "client_version": __version_major_minor__, } # cut and pasted from actual run of VRP example data. From 738e6ec8e7bab41b9d5b6407adc587eb48e27167 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 25 Aug 2025 10:33:10 -0500 Subject: [PATCH 12/14] fix style --- ci/utils/update_doc_versions.py | 1 + python/cuopt/cuopt/__init__.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/utils/update_doc_versions.py b/ci/utils/update_doc_versions.py index 61e4935b34..8c2a1e19a3 100644 --- a/ci/utils/update_doc_versions.py +++ b/ci/utils/update_doc_versions.py @@ -84,5 +84,6 @@ def main(): # Update versions update_versions(version_file_path, versions_file_path) + if __name__ == "__main__": main() diff --git a/python/cuopt/cuopt/__init__.py b/python/cuopt/cuopt/__init__.py index 5235bdb069..ab52891e3c 100644 --- a/python/cuopt/cuopt/__init__.py +++ b/python/cuopt/cuopt/__init__.py @@ -23,4 +23,3 @@ from cuopt import linear_programming, routing from cuopt._version import __git_commit__, __version__, __version_major_minor__ - From 02aaedaaab967ba0ba95808cb22a40b41d819f30 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 26 Aug 2025 14:59:48 -0500 Subject: [PATCH 13/14] move minor major version from cuopt to cuopt server --- python/cuopt_server/cuopt_server/__init__.py | 2 +- python/cuopt_server/cuopt_server/_version.py | 2 ++ python/cuopt_server/cuopt_server/utils/data_definition.py | 2 +- .../cuopt_server/utils/linear_programming/data_definition.py | 2 +- .../cuopt_server/cuopt_server/utils/routing/data_definition.py | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/cuopt_server/cuopt_server/__init__.py b/python/cuopt_server/cuopt_server/__init__.py index c8477dae4f..42f52c094c 100644 --- a/python/cuopt_server/cuopt_server/__init__.py +++ b/python/cuopt_server/cuopt_server/__init__.py @@ -14,4 +14,4 @@ # limitations under the License. from cuopt_server import cuopt_service -from cuopt_server._version import __git_commit__, __version__ +from cuopt_server._version import __git_commit__, __version__, __version_major_minor__ diff --git a/python/cuopt_server/cuopt_server/_version.py b/python/cuopt_server/cuopt_server/_version.py index ba27ac7b05..d0c1ac4afc 100644 --- a/python/cuopt_server/cuopt_server/_version.py +++ b/python/cuopt_server/cuopt_server/_version.py @@ -22,3 +22,5 @@ .strip() ) __git_commit__ = "" + +__version_major_minor__ = ".".join(__version__.split(".")[:2]) diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index 0e9424f07d..250c4b96e6 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -23,7 +23,7 @@ import jsonref from pydantic import BaseModel, Extra, Field -from cuopt import __version_major_minor__ +from .._version import __version_major_minor__ from .linear_programming.data_definition import ( # noqa IncumbentSolution, diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py index a0a63c3fcc..30dcf8695f 100644 --- a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py @@ -22,7 +22,7 @@ from pydantic import BaseModel, Extra, Field, PlainValidator from typing_extensions import Annotated -from cuopt import __version_major_minor__ +from ..._version import __version_major_minor__ # INPUT DATA DEFINITIONS diff --git a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py index b0f13cf252..530af4712d 100644 --- a/python/cuopt_server/cuopt_server/utils/routing/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/routing/data_definition.py @@ -21,7 +21,7 @@ import jsonref from pydantic import BaseModel, Extra, Field, RootModel, root_validator -from cuopt import __version_major_minor__ +from ..._version import __version_major_minor__ class LocationTypeEnum(str, Enum): From 8da742ee10db907888765a79d29e4db93d1580a3 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Tue, 26 Aug 2025 15:57:49 -0500 Subject: [PATCH 14/14] move minor major version from cuopt to cuopt server --- python/cuopt_server/cuopt_server/__init__.py | 6 +++++- python/cuopt_server/cuopt_server/utils/data_definition.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/cuopt_server/cuopt_server/__init__.py b/python/cuopt_server/cuopt_server/__init__.py index 42f52c094c..55a82de16f 100644 --- a/python/cuopt_server/cuopt_server/__init__.py +++ b/python/cuopt_server/cuopt_server/__init__.py @@ -14,4 +14,8 @@ # limitations under the License. from cuopt_server import cuopt_service -from cuopt_server._version import __git_commit__, __version__, __version_major_minor__ +from cuopt_server._version import ( + __git_commit__, + __version__, + __version_major_minor__, +) diff --git a/python/cuopt_server/cuopt_server/utils/data_definition.py b/python/cuopt_server/cuopt_server/utils/data_definition.py index 250c4b96e6..4fb5d8d2ce 100644 --- a/python/cuopt_server/cuopt_server/utils/data_definition.py +++ b/python/cuopt_server/cuopt_server/utils/data_definition.py @@ -24,7 +24,6 @@ from pydantic import BaseModel, Extra, Field from .._version import __version_major_minor__ - from .linear_programming.data_definition import ( # noqa IncumbentSolution, LPData,