forked from microsoft/TextWorld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
83 lines (69 loc) · 2.06 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import os
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.build_py import build_py
def _pre_install(dir):
from subprocess import check_call
check_call(['./setup.sh'], shell=True, cwd=os.getcwd())
class CustomInstall(install):
def run(self):
self.execute(_pre_install, (self.install_lib,),
msg="Running post install task")
install.run(self)
class CustomDevelop(develop):
def run(self):
self.execute(_pre_install, (self.install_lib,),
msg="Running post install task")
develop.run(self)
class CustomBuildPy(build_py):
def run(self):
_pre_install(None)
build_py.run(self)
setup(
name='textworld',
version=open(os.path.join("textworld", "version.py")).read().split("=")[-1].strip("' \n"),
author='',
cmdclass={
'build_py': CustomBuildPy,
'install': CustomInstall,
'develop': CustomDevelop
},
packages=find_packages(),
include_package_data=True,
scripts=[
"scripts/tw-data",
"scripts/tw-play",
"scripts/tw-make",
"scripts/tw-stats",
"scripts/tw-extract",
],
license='',
zip_safe=False,
description="Microsoft Textworld - A Text-based Learning Environment.",
cffi_modules=["glk_build.py:ffibuilder"],
setup_requires=['cffi>=1.0.0'],
install_requires=open('requirements.txt').readlines(),
test_suite='nose.collector',
tests_require=[
'nose==1.3.7',
],
extras_require={
'vis': [
'pybars3>=0.9.3',
'flask>=1.0.2',
'selenium>=3.12.0',
'greenlet==0.4.13',
'gevent==1.3.5',
'pillow>=5.1.0',
'plotly>=4.0.0',
'pydot>=1.2.4',
'psutil',
'matplotlib',
],
},
)