Skip to content

Commit

Permalink
introduce rapids-generate-pip-constraints (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Oct 31, 2024
1 parent b2ab625 commit 2cdbae8
Showing 1 changed file with 37 additions and 0 deletions.
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

0 comments on commit 2cdbae8

Please sign in to comment.