Skip to content

Commit

Permalink
Make sure the generated version is Python safe
Browse files Browse the repository at this point in the history
Currently dev builds have a zero prependet (e.g. dev0102). Python seems
to drop that 0 when passing to the build system, leading to a wheel with
a version without leading zero (dev101).

Don't use the leading zero to make it a valid Python version from the
beginning and avoid unexpected file names later on during the build.
  • Loading branch information
agners committed Jun 1, 2023
1 parent c0d2001 commit 229f224
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
elif [[ "${version}" =~ (main|dev) ]]; then
today="$(date --utc '+%Y-%m-%d')"
midnight_timestamp="$(date --utc +%s --date=$today)"
calver_date="$(date --utc --date=$today '+%Y.%-m.dev%d')"
calver_date="$(date --utc --date=$today '+%Y.%-m.dev%-d')"
commit_count="$(git rev-list --count --since=$midnight_timestamp HEAD)"
commit_count="$(printf "%02d" ${commit_count})"
version="${calver_date}${commit_count}"
Expand Down

0 comments on commit 229f224

Please sign in to comment.