Repository navigation
Conversation
Each subproject's build_docs.sh currently names the output subdir by importlib.metadata.version(), which on a pre-release checkout resolves to a PEP 440 .dev or +local string. When build_docs.sh is called without latest-only, that versioned subdir gets copied to latest/ and also published verbatim to gh-pages, where it accumulates as an orphan tree not reachable via nv-versions.json. Refuse that path explicitly in all three subprojects. Refs NVIDIA#3231.
📝 Summary
Priority: Change: Bug fix Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Major · Check the raw version before the default derivation strips it. · build_docs.sh:22-25
cuda_bindings_13/docs/build_docs.sh:22-25
🎯 Functional Correctness | 🟠 Major | ⚡ Quick winCheck the raw version before the default derivation strips it.
important: When
SPHINX_CUDA_BINDINGS_VERis unset, the default derivation reduces13.4.0.dev1and13.4.0+localto13.4.0. The publish guard never matches these versions, so pre-release builds still copy intobuild/html/latest.cuda_pathfinder/docs/build_docs.sh:22-25has the same derivation and the same problem. Incuda_core/docs/build_docs.sh:22-24,awkstrips only the+localsuffix, so.devversions still reach the guard but+localversions do not.Capture the raw version before normalization, and check that value in the guard:
Suggested fix
+# Keep the raw version for the publish guard. The normalized value drops .dev and +local. if [[ -z "${SPHINX_CUDA_BINDINGS_VER}" ]]; then + RAW_BINDINGS_VER=$(python -c "from importlib.metadata import version; print(version('cuda-bindings'))") export SPHINX_CUDA_BINDINGS_VER=$(python -c "from importlib.metadata import version; \ ver = '.'.join(str(version('cuda-bindings')).split('.')[:3]); \ print(ver)" \ | awk -F'+' '{print $1}') +else + RAW_BINDINGS_VER="${SPHINX_CUDA_BINDINGS_VER}" fi- if [[ "${SPHINX_CUDA_BINDINGS_VER}" == *.dev* || "${SPHINX_CUDA_BINDINGS_VER}" == *+* ]]; then - echo "refusing to publish versioned docs for pre-release version '${SPHINX_CUDA_BINDINGS_VER}'" >&2 + if [[ "${RAW_BINDINGS_VER}" == *.dev* || "${RAW_BINDINGS_VER}" == *+* ]]; then + echo "refusing to publish versioned docs for pre-release version '${RAW_BINDINGS_VER}'" >&2Apply the same pattern to
cuda_pathfinder/docs/build_docs.sh, usingSPHINX_CUDA_PATHFINDER_VERand thecuda-pathfinderpackage name. Apply it tocuda_core/docs/build_docs.sh, usingSPHINX_CUDA_CORE_VERand thecuda-corepackage name, so that+localversions are also caught.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: NVIDIA/cuda-python
- Branch: main
- File: .coderabbit.yaml
- Commit: 590a8bf
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Enterprise
- Run ID:
56fd6480-28ae-4c55-8123-632813ae1c41
Files selected for processing: 3-
cuda_bindings_13/docs/build_docs.shcuda_core/docs/build_docs.shcuda_pathfinder/docs/build_docs.sh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
-
| # versions, which otherwise leak orphan trees onto gh-pages that | ||
| # are not reachable via nv-versions.json. See #3231. | ||
| if [[ "${SPHINX_CUDA_BINDINGS_VER}" == *.dev* || "${SPHINX_CUDA_BINDINGS_VER}" == *+* ]]; then | ||
| echo "refusing to publish versioned docs for pre-release version '${SPHINX_CUDA_BINDINGS_VER}'" >&2 |
There was a problem hiding this comment.
minor: Use an error message that matches the guard. The branch rejects .dev and +, but the message says “pre-release version.” The guard allows alpha, beta, and release-candidate versions. Use wording such as “development or local version” in all three scripts.
|
/ok to test 601e106 |
|
Description
Refs #3231
Each subproject's
build_docs.shnames the output subdir byimportlib.metadata.version(). On a pre-release checkout that resolves to a PEP 440.devor+localversion. Whenbuild_docs.shis called withoutlatest-only, that versioned subdir gets copied tolatest/and published verbatim togh-pages, where it accumulates as an orphan tree not reachable vianv-versions.json. 26 such orphans were just purged from gh-pages at 30f5f0a — this patch keeps them from coming back.The guard allows alpha/beta/rc tags (
13.4.0b1,1.0.0rc1, …) and only refuses.dev*and+localversions.Checklist
build_docs.sh; guard logic smoke-tested locally against1.2.1.dev249,1.2.1+local,1.2.1,13.4.0b1,13.4.1a0,1.0.0rc1)-- Leo's bot