Skip to content

Commit

Permalink
Strip leading zeroes from version (#21532)
Browse files Browse the repository at this point in the history
When setting the Drake version automatically, strip leading zeroes in
order to maintain PEP 440 compliance. (Note that this logic is copied
from our CI drivers, which were already doing this.)
  • Loading branch information
mwoehlke-kitware authored Jun 6, 2024
1 parent 05ec310 commit 7228fd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/install/libdrake/generate_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ if(DEFINED DRAKE_VERSION_OVERRIDE)
set(DRAKE_VERSION "${DRAKE_VERSION_OVERRIDE}")
else()
string(TIMESTAMP BUILD_TIMESTAMP "%Y%m%d.%H%M%S")
set(DRAKE_VERSION "0.0.${BUILD_TIMESTAMP}+${BUILD_IDENTIFIER}")
string(REGEX REPLACE "[.]0+([0-9])" ".\\1"
DRAKE_VERSION "0.0.${BUILD_TIMESTAMP}+${BUILD_IDENTIFIER}")
endif()

configure_file(${INPUT_FILE} ${OUTPUT_FILE} @ONLY)

0 comments on commit 7228fd9

Please sign in to comment.