Skip to content

Commit bc3de07

Browse files
Remove comparison dependencies and skipIfs (#4031)
1 parent 879faa0 commit bc3de07

File tree

18 files changed

+19
-69
lines changed

18 files changed

+19
-69
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ if [[ "$(python --version)" = *3.9* || "$(python --version)" = *3.10* ]]; then
9898
fi
9999
(
100100
set -x
101-
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} sox libvorbis parameterized 'requests>=2.20'
102-
pip install kaldi-io SoundFile librosa coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag pyroomacoustics flashlight-text git+https://github.com/kpu/kenlm
101+
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} libvorbis parameterized 'requests>=2.20'
102+
pip install SoundFile coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag pyroomacoustics flashlight-text git+https://github.com/kpu/kenlm
103103

104104
# TODO: might be better to fix the single call to `pip install` above
105105
pip install pillow scipy "numpy>=1.26"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ fi
3030

3131
(
3232
cd test
33-
pytest torchaudio_unittest -k "not backend and not /io/ and not prototype and not sox and not ffmpeg and not fairseq and not hdemucs and not (torchscript and rnnt) and not torchscript_consistency"
33+
pytest torchaudio_unittest -k "not backend and not (sox and not compatibility) and not /io/ and not prototype and not ffmpeg and not fairseq and not hdemucs and not (torchscript and rnnt) and not torchscript_consistency"
3434
)

.github/scripts/unittest-windows/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
- scipy >= 1.4.1
99
- pip
1010
- pip:
11-
- kaldi-io
1211
- PySoundFile
1312
- future
1413
- parameterized

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ case "$(python --version)" in
6464
NUMBA_DEV_CHANNEL="-c numba/label/dev"
6565
;;
6666
esac
67-
# Note: installing librosa via pip fail because it will try to compile numba.
6867
(
69-
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} 'librosa==0.10.0' parameterized 'requests>=2.20'
68+
conda install -y -c conda-forge ${NUMBA_DEV_CHANNEL} parameterized 'requests>=2.20'
7069
# Need to disable shell check since this'll fail out if SENTENCEPIECE_DEPENDENCY is empty
7170
# shellcheck disable=SC2086
7271
pip install \
@@ -76,7 +75,6 @@ esac
7675
coverage \
7776
expecttest \
7877
inflect \
79-
kaldi-io \
8078
pytest \
8179
pytest-cov \
8280
pytorch-lightning \

.github/workflows/unittest-linux-gpu.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ jobs:
3434
export PYTHON_VERSION="${{ matrix.python_version }}"
3535
export CU_VERSION="${{ matrix.cuda_arch_version }}"
3636
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}"
37-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_APPLY_CMVN_SLIDING=true
38-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_FBANK_FEATS=true
39-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_KALDI_PITCH_FEATS=true
40-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_MFCC_FEATS=true
41-
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_NO_CMD_COMPUTE_SPECTROGRAM_FEATS=true
4237
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_CUDA_SMALL_MEMORY=true
4338
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_ON_PYTHON_310=true
4439
export TORCHAUDIO_TEST_ALLOW_SKIP_IF_TEMPORARY_DISABLED=true
@@ -82,9 +77,8 @@ jobs:
8277
# --quiet --yes \
8378
# -c conda-forge \
8479
# -c numba/label/dev \
85-
# sox libvorbis 'librosa==0.10.0' parameterized 'requests>=2.20'
80+
# libvorbis parameterized 'requests>=2.20'
8681
# pip3 install --progress-bar off \
87-
# kaldi-io \
8882
# SoundFile \
8983
# coverage \
9084
# pytest \
@@ -105,7 +99,7 @@ jobs:
10599
# git+https://github.com/pytorch/fairseq.git@e47a4c8
106100
107101
pip3 install parameterized requests
108-
pip3 install kaldi-io SoundFile librosa coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag
102+
pip3 install SoundFile coverage pytest pytest-cov scipy expecttest unidecode inflect Pillow sentencepiece pytorch-lightning 'protobuf<4.21.0' demucs tinytag
109103
pip3 install pillow scipy "numpy>=1.26"
110104
111105
echo "::endgroup::"

examples/hubert/utils/kmeans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from typing import Tuple
99

1010
import torch
11-
from sklearn.cluster import MiniBatchKMeans
1211
from torch import Tensor
1312

1413
from .common_utils import _get_feat_lens_paths, _get_model_path
@@ -102,6 +101,7 @@ def learn_kmeans(
102101
"""
103102
if not km_dir.exists():
104103
km_dir.mkdir()
104+
from sklearn.cluster import MiniBatchKMeans
105105

106106
km_model = MiniBatchKMeans(
107107
n_clusters=n_clusters,

src/torchaudio/_internal/module_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def decorator(func):
9797
{func.__doc__}
9898
"""
9999

100-
UNSUPPORTED.append(wrapped)
100+
# This is a temporary fix to avoid depending on sox during testing.
101+
# It will be removed once the sox dependency is removed from the rest of the codebase.
102+
if 'sox' not in func.__module__:
103+
UNSUPPORTED.append(wrapped)
101104
return wrapped
102105

103106
return decorator

test/torchaudio_unittest/common_utils/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
skipIfNoModule,
1616
skipIfNoQengine,
1717
skipIfNoRIR,
18-
skipIfNoSox,
19-
skipIfNoSoxDecoder,
20-
skipIfNoSoxEncoder,
2118
skipIfPy310,
2219
skipIfRocm,
2320
TempDirMixin,
@@ -63,9 +60,6 @@ def inject_request(self, request):
6360
"skipIfNoMacOS",
6461
"skipIfNoModule",
6562
"skipIfNoRIR",
66-
"skipIfNoSox",
67-
"skipIfNoSoxDecoder",
68-
"skipIfNoSoxEncoder",
6963
"skipIfRocm",
7064
"skipIfNoQengine",
7165
"skipIfNoFFmpeg",

0 commit comments

Comments
 (0)