-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pip wheel version script * add debugging to pip version script * Rewrite rapids-twine in bash * Address shellcheck suggestions * Print debug statements to stderr * Simplify rapids-pip-wheel-version * Pass epoch timestamp into pip-version script * Use set -u instead of rapids-require-env-var
- Loading branch information
Showing
3 changed files
with
68 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# A utility script that generates a pip wheel version | ||
# Positional Arguments: | ||
# 1) epoch timestamp | ||
set -exo pipefail | ||
export RAPIDS_SCRIPT_NAME="rapids-pip-wheel-version" | ||
|
||
if [ -z "$1" ]; then | ||
rapids-echo-stderr "Must specify input arguments: EPOCH_TIMESTAMP" | ||
exit 1 | ||
fi | ||
epoch_timestamp="$1" | ||
|
||
function distutilsNormalizeVersion { | ||
echo -n "$(python3 -c "from setuptools.extern import packaging; print(packaging.version.Version('$1'))")" | ||
} | ||
|
||
rapids-echo-stderr "pwd is $(pwd)" | ||
|
||
latest_git_tag="$(git describe --tag --abbrev=0)" | ||
|
||
# drop letters ('v', 'a', etc.) from tag | ||
# v22.12.00a -> 22.12.00 | ||
# v22.12.00 -> 22.12.00 | ||
|
||
latest_git_tag="${latest_git_tag//[a-z]/}" | ||
|
||
# normalize with distutils logic | ||
latest_git_tag="$(distutilsNormalizeVersion "${latest_git_tag}")" | ||
|
||
# add epoch timestamp so more recent wheels are installed first | ||
versioneer_override="$latest_git_tag.$epoch_timestamp" | ||
|
||
echo -n "${versioneer_override}" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# A utility script that wraps twine to support build tags (PEP427) | ||
# | ||
# Positional Arguments: | ||
# 1) wheel dir | ||
set -exou pipefail | ||
export RAPIDS_SCRIPT_NAME="rapids-twine" | ||
|
||
if [ -z "$1" ]; then | ||
rapids-echo-stderr "Must specify input arguments: WHEEL_DIR" | ||
exit 1 | ||
fi | ||
wheeldir="$1" | ||
|
||
build_tag="${RAPIDS_PY_WHEEL_BUILD_TAG:-""}" | ||
|
||
if [ "${build_tag}" != "" ]; then | ||
echo "Checking if build tag ${build_tag} is legal..." | ||
if [[ "${build_tag}" =~ [^[:digit:]] ]]; then | ||
rapids-echo-stderr "Build tag can only be digits" | ||
exit 1 | ||
fi | ||
|
||
echo "Need to apply build tag ${build_tag}..." | ||
for wheelfile in "${wheeldir}"/*.whl; do | ||
wheel_version=$(echo "$wheelfile" | cut -d'-' -f2) | ||
replacement_wheel_version="${wheel_version}-${build_tag}" | ||
wheelnewfile="${wheelfile/$wheel_version/$replacement_wheel_version}" | ||
|
||
mv "${wheelfile}" "${wheelnewfile}" | ||
done | ||
fi | ||
|
||
twine upload --disable-progress-bar --non-interactive "${wheeldir}"/*.whl |
This file was deleted.
Oops, something went wrong.