Skip to content

Commit 780bab0

Browse files
committed
Remove comparison deps and skipIfs
1 parent 15c15bb commit 780bab0

File tree

9 files changed

+5
-48
lines changed

9 files changed

+5
-48
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"

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",

test/torchaudio_unittest/common_utils/case_utils.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,28 +206,6 @@ def skipIfNoModule(module, display_name=None):
206206
reason="CUDA does not have enough memory.",
207207
key="CUDA_SMALL_MEMORY",
208208
)
209-
skipIfNoSox = _skipIf(
210-
not _IS_SOX_AVAILABLE,
211-
reason="Sox features are not available.",
212-
key="NO_SOX",
213-
)
214-
215-
216-
def skipIfNoSoxDecoder(ext):
217-
return _skipIf(
218-
not _IS_SOX_AVAILABLE or ext not in torchaudio.utils.sox_utils.list_read_formats(),
219-
f'sox does not handle "{ext}" for read.',
220-
key="NO_SOX_DECODER",
221-
)
222-
223-
224-
def skipIfNoSoxEncoder(ext):
225-
return _skipIf(
226-
not _IS_SOX_AVAILABLE or ext not in torchaudio.utils.sox_utils.list_write_formats(),
227-
f'sox does not handle "{ext}" for write.',
228-
key="NO_SOX_ENCODER",
229-
)
230-
231209

232210
skipIfNoRIR = _skipIf(
233211
not torchaudio._extension._IS_RIR_AVAILABLE,

test/torchaudio_unittest/compliance/kaldi/kaldi_compatibility_impl.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
get_asset_path,
66
load_params,
77
load_wav,
8-
skipIfNoExec,
98
TempDirMixin,
109
TestBaseMixin,
1110
RequestMixin
@@ -19,7 +18,6 @@ def assert_equal(self, output, *, expected, rtol=None, atol=None):
1918
self.assertEqual(output, expected, rtol=rtol, atol=atol)
2019

2120
@parameterized.expand(load_params("kaldi_test_fbank_args.jsonl"))
22-
@skipIfNoExec("compute-fbank-feats")
2321
def test_fbank(self, kwargs):
2422
"""fbank should be numerically compatible with compute-fbank-feats"""
2523
wave_file = get_asset_path("kaldi_file.wav")
@@ -30,7 +28,6 @@ def test_fbank(self, kwargs):
3028
self.assert_equal(result, expected=kaldi_result, rtol=1e-4, atol=1e-8)
3129

3230
@parameterized.expand(load_params("kaldi_test_spectrogram_args.jsonl"))
33-
@skipIfNoExec("compute-spectrogram-feats")
3431
def test_spectrogram(self, kwargs):
3532
"""spectrogram should be numerically compatible with compute-spectrogram-feats"""
3633
wave_file = get_asset_path("kaldi_file.wav")
@@ -41,7 +38,6 @@ def test_spectrogram(self, kwargs):
4138
self.assert_equal(result, expected=kaldi_result, rtol=1e-4, atol=1e-6)
4239

4340
@parameterized.expand(load_params("kaldi_test_mfcc_args.jsonl"))
44-
@skipIfNoExec("compute-mfcc-feats")
4541
def test_mfcc(self, kwargs):
4642
"""mfcc should be numerically compatible with compute-mfcc-feats"""
4743
wave_file = get_asset_path("kaldi_file.wav")

test/torchaudio_unittest/functional/functional_cpu_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import torchaudio.functional as F
55
from parameterized import parameterized
66
import unittest
7-
from torchaudio_unittest.common_utils import PytorchTestCase, skipIfNoSox, TorchaudioTestCase
7+
from torchaudio_unittest.common_utils import PytorchTestCase, TorchaudioTestCase
88

99
from .functional_impl import Functional, FunctionalCPUOnly
1010

@@ -24,7 +24,6 @@ class TestFunctionalFloat64(Functional, PytorchTestCase):
2424

2525

2626
@unittest.skip("deprecated")
27-
@skipIfNoSox
2827
class TestApplyCodec(TorchaudioTestCase):
2928
def _smoke_test(self, format, compression, check_num_frames):
3029
"""

test/torchaudio_unittest/functional/kaldi_compatibility_test_impl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import torch
22
import torchaudio.functional as F
3-
from torchaudio_unittest.common_utils import skipIfNoExec, TempDirMixin, TestBaseMixin, RequestMixin
3+
from torchaudio_unittest.common_utils import TempDirMixin, TestBaseMixin, RequestMixin
44
from torchaudio_unittest.common_utils.kaldi_utils import convert_args, run_kaldi
55

66

@@ -9,7 +9,6 @@ def assert_equal(self, output, *, expected, rtol=None, atol=None):
99
expected = expected.to(dtype=self.dtype, device=self.device)
1010
self.assertEqual(output, expected, rtol=rtol, atol=atol)
1111

12-
@skipIfNoExec("apply-cmvn-sliding")
1312
def test_sliding_window_cmn(self):
1413
"""sliding_window_cmn should be numerically compatible with apply-cmvn-sliding"""
1514
kwargs = {

test/torchaudio_unittest/functional/sox_compatibility_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
get_whitenoise,
66
load_wav,
77
save_wav,
8-
skipIfNoExec,
9-
skipIfNoSox,
108
sox_utils,
119
TempDirMixin,
1210
TorchaudioTestCase,
1311
RequestMixin
1412
)
1513

1614

17-
@skipIfNoSox
18-
@skipIfNoExec("sox")
1915
class TestFunctionalFiltering(TempDirMixin, TorchaudioTestCase, RequestMixin):
2016
def run_sox_effect(self, input_file, effect):
2117
output_file = self.get_temp_path("expected.wav")

test/torchaudio_unittest/transforms/sox_compatibility_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@
88
get_whitenoise,
99
load_wav,
1010
save_wav,
11-
skipIfNoExec,
12-
skipIfNoSox,
1311
sox_utils,
1412
TempDirMixin,
1513
TorchaudioTestCase,
1614
RequestMixin
1715
)
1816

1917

20-
@skipIfNoSox
21-
@skipIfNoExec("sox")
2218
class TestFunctionalFiltering(TempDirMixin, TorchaudioTestCase, RequestMixin):
2319
def run_sox_effect(self, input_file, effect):
2420
output_file = self.get_temp_path("expected.wav")

test/torchaudio_unittest/utils/sox_utils_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from torchaudio.utils import sox_utils
2-
from torchaudio_unittest.common_utils import PytorchTestCase, skipIfNoSox
2+
from torchaudio_unittest.common_utils import PytorchTestCase
33

44

5-
@skipIfNoSox
65
class TestSoxUtils(PytorchTestCase):
76
"""Smoke tests for sox_util module"""
87

0 commit comments

Comments
 (0)