-
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.
introduce rapids-generate-pip-constraints (#114)
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 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,37 @@ | ||
#!/bin/bash | ||
|
||
# Write out a constraints.txt file for use with 'pip'. | ||
# | ||
# For more context: | ||
# * https://github.com/rapidsai/shared-workflows/pull/228 | ||
# * https://github.com/rapidsai/cudf/pull/16570#discussion_r1735300231 | ||
# | ||
# Positional arguments: | ||
# | ||
# 1) file key to be passed to `rapids-dependency-file-generator --file-key` | ||
# 2) filepath to write the constraint data to | ||
# | ||
# [usage] | ||
# | ||
# rapids-generate-pip-constraints test_python ./constraints.txt | ||
# | ||
|
||
set -euo pipefail | ||
|
||
export RAPIDS_SCRIPT_NAME="rapids-generate-pip-constraints" | ||
|
||
file_key="${1}" | ||
out_file="${2}" | ||
|
||
if [[ "${RAPIDS_DEPENDENCIES}" == "oldest" ]]; then | ||
rapids-dependency-file-generator \ | ||
--output requirements \ | ||
--file-key "${file_key}" \ | ||
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \ | ||
| tee "${out_file}" | ||
elif [[ "${RAPIDS_DEPENDENCIES}" == "latest" ]]; then | ||
echo "" > "${out_file}" | ||
else | ||
rapids-echo-stderr "Got unrecognized value for RAPIDS_DEPENDENCIES: '${RAPIDS_DEPENDENCIES}'. Expected one of ('latest', 'oldest')." | ||
exit 1 | ||
fi |