Replace VERSION.TXT parsing with importlib.metadata for Drake version detection#573
Merged
RussTedrake merged 3 commits intomasterfrom May 2, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/RussTedrake/manipulation/sessions/da5fb52e-03a5-4a18-978c-bf07069763a8 Co-authored-by: RussTedrake <6442292+RussTedrake@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RussTedrake/manipulation/sessions/da5fb52e-03a5-4a18-978c-bf07069763a8 Co-authored-by: RussTedrake <6442292+RussTedrake@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove dependency on VERSION.TXT for Drake version retrieval
Replace VERSION.TXT parsing with importlib.metadata for Drake version detection
May 2, 2026
RussTedrake
approved these changes
May 2, 2026
Owner
RussTedrake
left a comment
There was a problem hiding this comment.
@RussTedrake made 1 comment.
Reviewable status: 0 of 1 files reviewed, all discussions resolved.
RussTedrake
approved these changes
May 2, 2026
Owner
RussTedrake
left a comment
There was a problem hiding this comment.
@RussTedrake reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on copilot[bot]).
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.
GetDrakeVersion()andDrakeVersionGreaterThan()relied on reading aVERSION.TXTfile from disk, which only exists for certain Drake install types and breaks for others (pip, rules_python, source builds, etc.).Changes
GetDrakeVersion(): ReplacedVERSION.TXTfile parsing withimportlib.metadata.version("drake"). Returns"source"onPackageNotFoundError(e.g. unregistered source installs).DrakeVersionGreaterThan(): Now delegates toGetDrakeVersion()instead of re-reading the file. Updated nightly version parsing to handle the"0.0.YYYYMMDD"format returned byimportlib.metadata(previously parsed a"YYYYMMDDHHMMSS"string fromVERSION.TXT).from pathlib import Pathimport.This change is