Skip to content

Commit 92a562e

Browse files
Merge pull request #1267 from ExpectationMax:master
PiperOrigin-RevId: 284042030
2 parents 95e5718 + aa9eb47 commit 92a562e

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

setup.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
'termcolor',
5454
'tqdm',
5555
'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"'
5664
]
5765

5866
TESTS_REQUIRE = [
@@ -61,28 +69,12 @@
6169
'mako',
6270
'pytest',
6371
'pytest-xdist',
72+
# Python 2 backports
73+
'mock;python_version<"2"',
6474
# TODO(b/142892342): Re-enable
6575
# 'tensorflow-docs @ git+https://github.com/tensorflow/docs#egg=tensorflow-docs', # pylint: disable=line-too-long
6676
]
6777

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-
8678
# Static files needed by datasets.
8779
DATASET_FILES = [
8880
'image/caltech101_labels.txt',

0 commit comments

Comments
 (0)