-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
77 lines (63 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
#!/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")).readlines()[0].split("=")[-1].strip("' \n"),
author='Microsoft Textworld',
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",
"scripts/tw-view",
],
license='',
zip_safe=False,
url="https://github.com/microsoft/TextWorld",
description="Microsoft Textworld - A Text-based Learning Environment.",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
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': open('requirements-vis.txt').readlines(),
'full': open('requirements-full.txt').readlines(),
},
)