|
53 | 53 | 'termcolor',
|
54 | 54 | 'tqdm',
|
55 | 55 | 'wrapt',
|
| 56 | + # Python 2 backports |
| 57 | + 'bz2file;python_version<"2"', |
| 58 | + 'functools32;python_version<"2"', |
| 59 | + 'futures;python_version<"2"', |
| 60 | + # shutil.disk_usage was introduced in Python 3.3, use psutil instead. |
| 61 | + 'psutil;python_version<"3.3"', |
| 62 | + # enum introduced in Python 3.4 |
| 63 | + 'enum34;python_version<"3.4"' |
56 | 64 | ]
|
57 | 65 |
|
58 | 66 | TESTS_REQUIRE = [
|
|
61 | 69 | 'mako',
|
62 | 70 | 'pytest',
|
63 | 71 | 'pytest-xdist',
|
| 72 | + # Python 2 backports |
| 73 | + 'mock;python_version<"2"', |
64 | 74 | # TODO(b/142892342): Re-enable
|
65 | 75 | # 'tensorflow-docs @ git+https://github.com/tensorflow/docs#egg=tensorflow-docs', # pylint: disable=line-too-long
|
66 | 76 | ]
|
67 | 77 |
|
68 |
| -if sys.version_info.major == 3: |
69 |
| - # Packages only for Python 3 |
70 |
| - pass |
71 |
| -else: |
72 |
| - # Packages only for Python 2 |
73 |
| - TESTS_REQUIRE.append('mock') |
74 |
| - REQUIRED_PKGS.append('bz2file') |
75 |
| - REQUIRED_PKGS.append('functools32') |
76 |
| - REQUIRED_PKGS.append('futures') # concurrent.futures |
77 |
| - |
78 |
| -if sys.version_info < (3, 4): |
79 |
| - # enum introduced in Python 3.4 |
80 |
| - REQUIRED_PKGS.append('enum34') |
81 |
| - |
82 |
| -if sys.version_info < (3, 3): |
83 |
| - # shutil.disk_usage was introduced in Python 3.3, use psutil instead. |
84 |
| - REQUIRED_PKGS.append('psutil') |
85 |
| - |
86 | 78 | # Static files needed by datasets.
|
87 | 79 | DATASET_FILES = [
|
88 | 80 | 'image/caltech101_labels.txt',
|
|
0 commit comments