Skip to content

Commit 3ab7fe7

Browse files
committed
Use conda activate instead of conda run
1 parent b592a74 commit 3ab7fe7

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

.github/scripts/unittest-windows/install.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1414

1515
cd "${root_dir}"
1616

17-
# # 0. Activate conda env
18-
# eval "$("${conda_dir}/Scripts/conda.exe" 'shell.bash' 'hook')"
19-
# conda activate "${env_dir}"
17+
# 0. Activate conda env
18+
eval "$("${conda_dir}/Scripts/conda.exe" 'shell.bash' 'hook')"
19+
conda activate "${env_dir}"
2020

2121
source "$this_dir/set_cuda_envs.sh"
2222

@@ -28,9 +28,9 @@ else
2828
fi
2929

3030
PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/${GPU_ARCH_ID}"
31-
conda run -p "${env_dir}" pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
31+
pip install --progress-bar=off --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
3232

33-
torch_cuda=$(conda run -p "${env_dir}" python -c "import torch; print(torch.cuda.is_available())")
33+
torch_cuda=$(python -c "import torch; print(torch.cuda.is_available())")
3434
echo torch.cuda.is_available is $torch_cuda
3535

3636
if [ ! -z "${CUDA_VERSION:-}" ] ; then
@@ -42,13 +42,13 @@ fi
4242

4343
# 2. Install torchaudio
4444
printf "* Installing torchaudio\n"
45-
conda run -p "${env_dir}" "$root_dir/packaging/vc_env_helper.bat" pip install . -v --no-build-isolation
45+
"$root_dir/packaging/vc_env_helper.bat" pip install . -v --no-build-isolation
4646

4747
# 3. Install Test tools
4848
printf "* Installing test tools\n"
4949
NUMBA_DEV_CHANNEL=""
5050
SENTENCEPIECE_DEPENDENCY="sentencepiece"
51-
case "$(conda run -p "${env_dir}" python --version)" in
51+
case "$(python --version)" in
5252
*3.9*)
5353
# Numba isn't available for Python 3.9 except on the numba dev channel and building from source fails
5454
# See https://github.com/librosa/librosa/issues/1270#issuecomment-759065048
@@ -61,10 +61,10 @@ case "$(conda run -p "${env_dir}" python --version)" in
6161
;;
6262
esac
6363
(
64-
conda install -p "${env_dir}" -y -c conda-forge ${NUMBA_DEV_CHANNEL} parameterized 'requests>=2.20'
64+
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} parameterized 'requests>=2.20'
6565
# Need to disable shell check since this'll fail out if SENTENCEPIECE_DEPENDENCY is empty
6666
# shellcheck disable=SC2086
67-
conda run -p "${env_dir}" pip install \
67+
pip install \
6868
${SENTENCEPIECE_DEPENDENCY} \
6969
coverage \
7070
'numpy >=1.26' \

.github/scripts/unittest-windows/run_test.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
set -euxo pipefail
44

5-
# eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
5+
eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
66

77
this_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
88
source "$this_dir/set_cuda_envs.sh"
99

10-
root_dir="$(git rev-parse --show-toplevel)"
11-
env_dir="${root_dir}/env"
12-
13-
conda run -p "${env_dir}" python -m torch.utils.collect_env
10+
python -m torch.utils.collect_env
1411
env | grep TORCHAUDIO || true
1512

1613
cd test
17-
conda run -p "${env_dir}" pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa"
18-
conda run -p "${env_dir}" coverage html
14+
pytest --continue-on-collection-errors --cov=torchaudio --junitxml=${RUNNER_TEST_RESULTS_DIR}/junit.xml -v --durations 20 torchaudio_unittest -k "not torchscript and not fairseq and not demucs and not librosa"
15+
coverage html

.github/scripts/unittest-windows/setup_env.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ if [ ! -d "${conda_dir}" ]; then
1919
printf "* Installing conda\n"
2020
export tmp_conda="$(echo $conda_dir | tr '/' '\\')"
2121
export miniconda_exe="$(echo $root_dir | tr '/' '\\')\\miniconda.exe"
22-
curl --silent --output miniconda.exe https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -O
22+
# not using miniconda because its installation will be incomplete
23+
# despite using `start /wait` in the install batch file
24+
curl -L --silent --output miniconda.exe https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe -O
2325
"$this_dir/install_conda.bat"
2426
unset tmp_conda
2527
unset miniconda_exe
@@ -34,5 +36,5 @@ fi
3436
conda init bash
3537

3638
# 3. Install minimal build tools
37-
conda run -p "${env_dir}" pip --quiet install cmake ninja
38-
conda install -p "${env_dir}" -y 'ffmpeg>=4.1'
39+
pip --quiet install cmake ninja
40+
conda install -y 'ffmpeg>=4.1'

0 commit comments

Comments
 (0)