Skip to content

Commit

Permalink
Modify build date during PyPI builds for pre-release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Jun 26, 2023
1 parent 210937e commit 937919b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ci/build_python_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@ python -m pip install build --user
export GIT_DESCRIBE_TAG=$(git describe --abbrev=0 --tags)
export GIT_DESCRIBE_NUMBER=$(git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count)

# Build date for PyPI pre-releases
export BUILD_DATE=$(date +%y%m%d)

# Compute/export RAPIDS_DATE_STRING
source rapids-env-update

# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak
}

# Update pyproject.toml with pre-release build date
sed_runner "s/^version = \"23.08.00\"/version = \"23.08.00a"${BUILD_DATE}"\"/g" pyproject.toml

python -m build \
--sdist \
--wheel \
--outdir dist/ \
.

# Revert pyproject.toml pre-release build date
sed_runner "s/^version = \"23.08.00a"${BUILD_DATE}"\"/version = \"23.08.00\"/g" pyproject.toml

0 comments on commit 937919b

Please sign in to comment.