[ci] Consolidate version query scripts into shared Python module#12112
Closed
PavelGuzenfeld wants to merge 1 commit into
Closed
[ci] Consolidate version query scripts into shared Python module#12112PavelGuzenfeld wants to merge 1 commit into
PavelGuzenfeld wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract duplicated inline Python from
query-latest-cccl.shandquery-latest-rmm.shinto a sharedquery-latest-version.pyscript. 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.pyhandles both repos: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
--disallow-untyped-defs