Skip to content

Commit e366980

Browse files
committed
feat(ci): use pep440 local version for non-releases
1 parent b1454fc commit e366980

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@ RUN <<EOR
4848

4949
##
5050
# Converts the output of `git describe` to a valid python version (PEP 440),
51-
# e.g. `v0.4.9.2` to `0.4.9.2` or `ver0.4.8.11-3-123-g030686f` to `0.4.8.11.3.123.dev3172463`
51+
# e.g. `v0.4.9.2` to `0.4.9.2` or `ver0.4.8.11-3-123-g030686f` to `0.4.8.11.3.123+g030686f`
5252
##
53-
convert_git_description_to_python_version() {
53+
convert_git_description_to_pep440() {
5454
description="${1}"
5555
hash="${description##*-g}"
5656
version="$(printf %s "${description%-g*}" | tr -c -s [0-9.] .)"
5757
version="${version#.}"
5858
version="${version%.}"
5959
if [ "${hash}" != "${description}" ]; then
60-
version="${version}.dev$(printf %d "0x${hash}")"
60+
version="${version}+g${hash}"
6161
fi
6262
printf '%s\n' "${version}"
6363
}
6464
if [ -z "${DAEMON_VERSION-}" ] && [ "${GIT_DESCRIPTION-}" ]; then
65-
DAEMON_VERSION="$(convert_git_description_to_python_version "${GIT_DESCRIPTION}")"
65+
DAEMON_VERSION="$(convert_git_description_to_pep440 "${GIT_DESCRIPTION}")"
6666
fi
6767
if [ "${DAEMON_VERSION-}" ]; then
6868
sed -i -E "s/^ *DAEMON_VERSION *= *.+/DAEMON_VERSION = \"${DAEMON_VERSION}\"/" scc/constants.py

0 commit comments

Comments
 (0)