-
Notifications
You must be signed in to change notification settings - Fork 37
/
setup.py
46 lines (39 loc) · 1.36 KB
/
setup.py
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
#!/usr/bin/env python
import os
import sys
import setuptools
import build as java
from setuptools import setup, find_packages
from setuptools.command.install import install
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
#Run gym_gvgai/envs/gvgai/build.py to compile Java source code.
path = os.path.join(os.path.dirname(__file__), "gym_gvgai", "envs", "gvgai")
class InstallWithJava(install):
def run(self):
"""compile special java dependencies before the others."""
java.main(path)
install.run(self)
class DevelopWithJava(develop):
def run(self):
"""compile special java dependencies before the others."""
java.main(path)
develop.run(self)
class EggInfoWithJava(egg_info):
def run(self):
"""compile special java dependencies before the others."""
#java.main(path)
egg_info.run(self)
setup(name='gym_gvgai',
version='0.0.3',
packages= find_packages(),
install_requires=['gym>=0.10.5', 'numpy>=1.13.3', 'pillow>=5.3.0', 'scipy>=1.0.0,<1.2.0'],
cmdclass = {
'install': InstallWithJava,
'develop': DevelopWithJava,
'egg_info': EggInfoWithJava,
}
)
#Make sure a git pull doesn't result in weird error where java isn't rebuilt
#so the compiled code doesnt match the source code.
# Solution: Git hook -> post-merge -> delete build directory