Skip to content

Commit bbfd041

Browse files
authored
Make torchaudio work on Python 2. (#210)
#209
1 parent b9cac74 commit bbfd041

25 files changed

+39
-16
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ cache:
1212
matrix:
1313
fast_finish: true
1414
include:
15-
# TODO add this back in when there is a pytorch 1.2 for python 3.5
16-
# - env: PYTHON_VERSION="3.5"
15+
- env: PYTHON_VERSION="3.7"
1716
- env: PYTHON_VERSION="3.6"
17+
# TODO add this back in when there is a pytorch 1.2 for python 3.5
1818
- env: PYTHON_VERSION="3.5" RUN_FLAKE8="true" SKIP_TESTS="true"
19+
- env: PYTHON_VERSION="2.7"
1920

2021
addons:
2122
apt:

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ librosa>=0.4.3
1414
scipy
1515

1616
# Unit tests with pytest
17-
pytest
17+
pytest
18+
19+
# Testing only Py3 compat
20+
backports.tempfile

test/common_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import os
23
from shutil import copytree
3-
import tempfile
4+
import backports.tempfile as tempfile
45
import torch
56

67
TEST_DIR_PATH = os.path.dirname(os.path.realpath(__file__))

test/compliance/generate_fbank_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import argparse
23
import logging
34
import os

test/compliance/generate_test_stft_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import argparse
23
import logging
34
import os

test/compliance/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import random
23
import torchaudio
34

test/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import unittest
23
import common_utils
34
import torch

test/test_compliance_kaldi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import math
23
import os
34
import common_utils

test/test_dataloader.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import unittest
23
import common_utils
34
import torch

test/test_datasets_vctk.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import absolute_import, division, print_function, unicode_literals
12
import os
23

34
import torch

0 commit comments

Comments
 (0)