Skip to content

[ci] Consolidate version query scripts into shared Python module#12112

Closed
PavelGuzenfeld wants to merge 1 commit into
dmlc:masterfrom
PavelGuzenfeld:ci/consolidate-query-latest-version
Closed

[ci] Consolidate version query scripts into shared Python module#12112
PavelGuzenfeld wants to merge 1 commit into
dmlc:masterfrom
PavelGuzenfeld:ci/consolidate-query-latest-version

Conversation

@PavelGuzenfeld

Copy link
Copy Markdown
Contributor

Summary

Extract duplicated inline Python from query-latest-cccl.sh and query-latest-rmm.sh into a shared query-latest-version.py script. Ref #11870.

Before: Each shell script created a tmpfile with ~20 lines of inline Python (parsing version tags via packaging.Version), ran it, then cleaned up. The logic was near-identical between the two scripts.

After: A single query-latest-version.py handles both repos:

python3 ops/pipeline/query-latest-version.py --repo NVIDIA/cccl
python3 ops/pipeline/query-latest-version.py --repo rapidsai/rmm --extract-minor

The shell scripts become thin wrappers (4 lines each) that set the expected environment variable. No workflow YAML changes needed.

Net result: -42 lines of duplicated bash/inline-python, +74 lines of clean Python with proper arg parsing and error handling.

Test plan

  • CI pre-commit passes (verified locally in Docker container)
  • ruff check + ruff format pass
  • mypy passes with --disallow-untyped-defs

Extract the duplicated embedded Python version-query logic from
query-latest-cccl.sh and query-latest-rmm.sh into a shared
query-latest-version.py script.

Before: each shell script created a tmpfile with ~20 lines of inline
Python, ran it, then cleaned up. The logic was near-identical.

After: a single Python script handles both repos via --repo flag.
The shell scripts become thin wrappers that set the expected env var.

No workflow changes needed — shell scripts retain the same interface.

Ref: dmlc#11870
PavelGuzenfeld added a commit to PavelGuzenfeld/xgboost that referenced this pull request Mar 19, 2026
@trivialfis
trivialfis requested a review from hcho3 March 20, 2026 07:15
@trivialfis trivialfis closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants