Skip to content

Commit

Permalink
Another try
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed Jul 17, 2020
1 parent de07865 commit f6207b0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dev/run-pip-tests
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,18 @@ for python in "${PYTHON_EXECS[@]}"; do
echo "Using $VIRTUALENV_BASE for virtualenv"
VIRTUALENV_PATH="$VIRTUALENV_BASE"/$python
rm -rf "$VIRTUALENV_PATH"
USE_CONDA_CMD=0
if [ -n "$USE_CONDA" ]; then
if [ -f "$CONDA_PREFIX/etc/profile.d/conda.sh" ]; then
# See also https://github.com/conda/conda/issues/7980
USE_CONDA_CMD=1
source "$CONDA_PREFIX/etc/profile.d/conda.sh"
fi
conda create -y -p "$VIRTUALENV_PATH" python=$python numpy pandas pip setuptools
if [ -z "$CONDA_PREFIX" ]; then
source activate "$VIRTUALENV_PATH"
else
if [ $USE_CONDA_CMD == 1 ]; then
conda activate "$VIRTUALENV_PATH"
else
source activate "$VIRTUALENV_PATH"
fi
else
mkdir -p "$VIRTUALENV_PATH"
Expand Down Expand Up @@ -131,10 +133,10 @@ for python in "${PYTHON_EXECS[@]}"; do

# conda / virtualenv environments need to be deactivated differently
if [ -n "$USE_CONDA" ]; then
if [ -z "$CONDA_PREFIX" ]; then
source deactivate
else
if [ $USE_CONDA_CMD == 1 ]; then
conda deactivate
else
source deactivate
fi
else
deactivate
Expand Down

0 comments on commit f6207b0

Please sign in to comment.