-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
145 lines (123 loc) · 5.77 KB
/
setup.py
File metadata and controls
145 lines (123 loc) · 5.77 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import distutils
import os
from distutils.core import setup
import _version
import pip
pip.main(['install', 'appdirs'])
# from setuptools.command import build_py
__basedir__ = _version.__basedir__
__version__ = _version.__version__
appname = 'prac'
appauthor = 'danielnyga'
def iamroot():
'''Checks if this process has admin permissions.'''
try:
return os.getuid() == 0
except AttributeError:
import ctypes
return ctypes.windll.shell32.IsUserAnAdmin() != 0
def basedir(name):
return os.path.join(__basedir__, name)
with open(os.path.join(os.path.dirname(__file__), __basedir__, 'requirements.txt'), 'r') as f:
requirements = [l.strip() for l in f.readlines() if l.strip()]
def datafiles(d):
data_files = []
for root, dirs, files in os.walk(os.path.join(os.path.dirname(__file__), d)):
if not files: continue
root_ = root.replace(os.getcwd() + os.path.sep, '')
data_files.append((root_, [os.path.join(root_, f) for f in files]))
return data_files
def datapath():
'''Returns the path where app data is to be installed.'''
import appdirs
if iamroot():
return appdirs.site_data_dir(appname, appauthor)
else:
return appdirs.user_data_dir(appname, appauthor)
class myinstall(distutils.command.install.install):
def __init__(self, *args, **kwargs):
distutils.command.install.install.__init__(self, *args, **kwargs)
self.distribution.get_command_obj('install_data').install_dir = datapath()
setup(
name='prac',
packages=['prac',
'prac._version',
'prac.core',
'prac.db', 'prac.db.ies',
'prac.googlevoice',
'prac.pracutils', 'prac.pracutils.conv',
'prac.text2speech',
'prac.pracmodules',
'prac.pracmodules.ac_recognition', 'prac.pracmodules.ac_recognition.src', 'prac.pracmodules.ac_recognition.mln',
'prac.pracmodules.achieved_by', 'prac.pracmodules.achieved_by.src', 'prac.pracmodules.achieved_by.mln',
'prac.pracmodules.complex_achieved_by', 'prac.pracmodules.complex_achieved_by.src',
'prac.pracmodules.coref_resolution', 'prac.pracmodules.coref_resolution.src', 'prac.pracmodules.coref_resolution.mln',
'prac.pracmodules.cs_recognition', 'prac.pracmodules.cs_recognition.src', 'prac.pracmodules.cs_recognition.mln',
'prac.pracmodules.nl_parsing', 'prac.pracmodules.nl_parsing.src', 'prac.pracmodules.nl_parsing.mln',
'prac.pracmodules.obj_recognition', 'prac.pracmodules.obj_recognition.src', 'prac.pracmodules.obj_recognition.mln',
'prac.pracmodules.plan_generation', 'prac.pracmodules.plan_generation.src',
'prac.pracmodules.prop_extraction', 'prac.pracmodules.prop_extraction.src', 'prac.pracmodules.prop_extraction.mln',
'prac.pracmodules.role_look_up', 'prac.pracmodules.role_look_up.src',
'prac.pracmodules.roles_transformation', 'prac.pracmodules.roles_transformation.src',
'prac.pracmodules.senses_and_roles', 'prac.pracmodules.senses_and_roles.src', 'prac.pracmodules.senses_and_roles.mln',
'prac.pracmodules.wn_senses', 'prac.pracmodules.wn_senses.src', 'prac.pracmodules.wn_senses.mln', 'prac.pracmodules.wn_senses.bin',
'prac.pracmodules.wsd', 'prac.pracmodules.wsd.src', 'prac.pracmodules.wsd.mln', 'prac.pracmodules.wsd.bin',
],
py_modules=[
'practell',
'pracquery',
'pracparse',
'senses'
],
package_dir={
'prac': basedir('prac'),
'prac._version': '_version',
'': __basedir__
},
package_data={'': ['*']},
data_files=datafiles('examples') + datafiles('3rdparty') +
datafiles('data') + datafiles('etc') + datafiles('models'),
version=__version__,
description='PRAC - Probabilistic Action Cores - an interpreter for '
'natural-language instructions which is able to resolve '
'vagueness and ambiguity in natural language and infer missing '
'information pieces that are required to render an instruction '
'executable by a robot.',
author='Daniel Nyga, Mareike Picklum',
author_email='nyga@cs.uni-bremen.de, mareikep@cs.uni-bremen.de',
url='https://actioncores.org',
download_url='https://github.com/danielnyga/prac/archive/%s.tar.gz' % __version__,
keywords=['natural-language interpretation', 'prac',
'probabilistic action cores', 'robot instructions'],
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Artificial Intelligence ',
'Topic :: Text Processing',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
install_requires=requirements,
entry_points={
'console_scripts': [
'pracquery=pracquery:main',
'pracparse=pracparse:main',
'practell=practell:main',
'pracsenses=senses:main',
'pracxfold=pracxfold:main',
],
},
cmdclass={'install': myinstall}
)