summary refs log tree commit diff
path: root/pkgs/development/python-modules/pysc2/fix-setup-for-py3.patch
blob: b1a2b4e2350a9b3f5d1aa6b6b235a3b08e54817f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff --git a/setup.py b/setup.py
index 020768f..13c2b67 100755
--- a/setup.py
+++ b/setup.py
@@ -17,6 +17,8 @@ from __future__ import absolute_import
 from __future__ import division
 from __future__ import print_function
 
+import sys
+
 from setuptools import setup
 
 description = """PySC2 - StarCraft II Learning Environment
@@ -36,6 +38,27 @@ some initial research results using the environment.
 Read the README at https://github.com/deepmind/pysc2 for more information.
 """
 
+requires = [
+    'absl-py>=0.1.0',
+    'future',
+    'mock',
+    'mpyq',
+    'numpy>=1.10',
+    'portpicker>=1.2.0',
+    'protobuf>=2.6',
+    'pygame',
+    's2clientprotocol>=3.19.0.58400.0',
+    'six',
+    'websocket-client',
+]
+
+if sys.version_info[0] == 2:
+    requires.append('futures')
+
+if (sys.version_info[0] == 2
+        or (sys.version_info[0] == 3 and sys.version_info[1] < 4)):
+    requires.append('enum34')
+
 setup(
     name='PySC2',
     version='1.2',
@@ -56,21 +79,7 @@ setup(
         'pysc2.run_configs',
         'pysc2.tests',
     ],
-    install_requires=[
-        'absl-py>=0.1.0',
-        'enum34',
-        'future',
-        'futures',
-        'mock',
-        'mpyq',
-        'numpy>=1.10',
-        'portpicker>=1.2.0',
-        'protobuf>=2.6',
-        'pygame',
-        's2clientprotocol>=3.19.0.58400.0',
-        'six',
-        'websocket-client',
-    ],
+    install_requires=requires,
     entry_points={
         'console_scripts': [
             'pysc2_agent = pysc2.bin.agent:entry_point',