Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ repos:
- id: shellcheck
args: ["--severity=warning"]
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v1.3.3
rev: v1.4.3
hooks:
- id: verify-copyright
args: [--fix, --spdx]
Expand All @@ -81,6 +81,21 @@ repos:
exclude: |
(?x)
^pyproject[.]toml$
- id: verify-hardcoded-version
exclude: |
(?x)
(^|/)devcontainer[.]json$|
(^|/)dependencies[.]yaml$|
^[.]github/(workflows|ISSUE_TEMPLATE)/|
(^|/)pom[.]xml$|
^[.]pre-commit-config[.]yaml$|
^conda/environments/|
(^|/)VERSION$|
(^|/)RAPIDS_BRANCH$|
[.](md|rst|avro|parquet|png|orc|gz|pkl|sas7bdat|msgpack|pickle|jpg|bz2|zlib)$|
^docs/cuopt/source/cuopt-python/routing/routing-example[.]ipynb$|
^docs/cuopt/source/versions1[.]json$|
^helmchart/cuopt-server/(Chart[.]yaml|values[.]yaml)$
- repo: local
hooks:
- id: update-versions
Expand Down
4 changes: 0 additions & 4 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ for DEP in "${DEPENDENCIES[@]}"; do
done
done

# 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 README.md version badge
sed_runner 's/badge\/version-[0-9]\+\.[0-9]\+\.[0-9]\+-blue/badge\/version-'${NEXT_FULL_TAG}'-blue/g' README.md

Expand Down
23 changes: 21 additions & 2 deletions docs/cuopt/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0


Expand All @@ -11,6 +11,10 @@
import subprocess
import sys
import os
import tempfile
import json
from sphinx.util.fileutil import copy_asset_file
from pathlib import Path

# Run cuopt server help command and save output
subprocess.run(
Expand Down Expand Up @@ -166,7 +170,7 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = ["swagger-nvidia.css"]
html_extra_path = ["project.json", "versions1.json"]
html_extra_path = ["versions1.json"]


# -- Options for Breathe (Doxygen) ----------------------------------------
Expand Down Expand Up @@ -330,6 +334,20 @@ def skip_unwanted_inherited_members(app, what, name, obj, skip, options):
return skip


def write_project_json(app, _builder):
json_data = {
"name": "cuopt",
"version": cuopt.__version__,
"url": "https://github.com/nvidia/cuopt",
"description": "NVIDIA cuOpt is an optimization engine",
}
with tempfile.TemporaryDirectory() as d:
path = Path(d) / "project.json"
with open(path, "w") as f:
json.dump(json_data, f)
copy_asset_file(path, app.outdir / "project.json")


intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
}
Expand Down Expand Up @@ -363,3 +381,4 @@ def skip_unwanted_inherited_members(app, what, name, obj, skip, options):
def setup(app):
app.setup_extension("sphinx.ext.autodoc")
app.connect("autodoc-skip-member", skip_unwanted_inherited_members)
app.connect("write-started", write_project_json)
1 change: 0 additions & 1 deletion docs/cuopt/source/project.json

This file was deleted.