Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions tools/rapids-generate-pip-constraints
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