allow installing from test.pypi.org

This commit is contained in:
Ashwin Bharambe 2024-08-08 12:55:03 -07:00
parent 7b37ed5dae
commit 83adaae09b

View file

@ -8,6 +8,7 @@
LLAMA_MODELS_DIR=${LLAMA_MODELS_DIR:-} LLAMA_MODELS_DIR=${LLAMA_MODELS_DIR:-}
LLAMA_TOOLCHAIN_DIR=${LLAMA_TOOLCHAIN_DIR:-} LLAMA_TOOLCHAIN_DIR=${LLAMA_TOOLCHAIN_DIR:-}
USE_TEST_PYPI=${USE_TEST_PYPI:-}
set -euo pipefail set -euo pipefail
@ -56,6 +57,12 @@ ensure_conda_env_python310() {
eval "$(conda shell.bash hook)" eval "$(conda shell.bash hook)"
conda deactivate && conda activate "${env_name}" conda deactivate && conda activate "${env_name}"
PIP_ARGS=""
if [ "$USE_TEST_PYPI" = "1" ]; then
# these packages are damaged in test-pypi, so install them first
pip install fastapi libcst
PIP_ARGS="--extra-index-url https://test.pypi.org/simple/"
fi
# Re-installing llama-toolchain in the new conda environment # Re-installing llama-toolchain in the new conda environment
if [ -n "$LLAMA_TOOLCHAIN_DIR" ]; then if [ -n "$LLAMA_TOOLCHAIN_DIR" ]; then
if [ ! -d "$LLAMA_TOOLCHAIN_DIR" ]; then if [ ! -d "$LLAMA_TOOLCHAIN_DIR" ]; then
@ -66,7 +73,7 @@ ensure_conda_env_python310() {
echo "Installing from LLAMA_TOOLCHAIN_DIR: $LLAMA_TOOLCHAIN_DIR" echo "Installing from LLAMA_TOOLCHAIN_DIR: $LLAMA_TOOLCHAIN_DIR"
pip install -e "$LLAMA_TOOLCHAIN_DIR" pip install -e "$LLAMA_TOOLCHAIN_DIR"
else else
pip install llama-toolchain pip install $PIP_ARGS llama-toolchain
fi fi
if [ -n "$LLAMA_MODELS_DIR" ]; then if [ -n "$LLAMA_MODELS_DIR" ]; then
@ -83,7 +90,7 @@ ensure_conda_env_python310() {
# Install pip dependencies # Install pip dependencies
if [ -n "$pip_dependencies" ]; then if [ -n "$pip_dependencies" ]; then
echo "Installing pip dependencies: $pip_dependencies" echo "Installing pip dependencies: $pip_dependencies"
pip install $pip_dependencies pip install $PIP_ARGS $pip_dependencies
fi fi
} }