-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
executable file
·147 lines (129 loc) · 5.78 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
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
146
147
from sys import (exit,
stderr,
version_info)
from os import (getcwd,
listdir)
from shutil import copy
from os.path import (join,
exists,
dirname,
realpath)
from getpass import getuser
from subprocess import getoutput
from setuptools import setup
from distutils.extension import Extension
from distutils.command.build import build as _build
if version_info < (3, 0):
raise Exception('Installation requires Python >= 3.0.')
# Set this to True to enable building extensions using Cython.
# Set it to False to build extensions from the C file (that
# was previously created using Cython).
# Set it to 'auto' to build with Cython if available, otherwise
# from the C file.
USE_CYTHON = True
cmdclass = {}
class build(_build):
def run(self):
__builtins__.__NUMPY_SETUP__ = False
import numpy
print(numpy.get_include())
_build.run(self)
def readme():
with open('README.md') as f:
return f.read()
def reqs():
with open('requirements.txt') as f:
return f.read().splitlines()
def get_python_header_dir():
# Hackish way of doing this. Find better way...
root_env = getoutput('conda info | grep "package cache :"'
' | awk \'{print $4}\'')
# Try to guess the location of the conda installation
if not root_env:
root_env = '/home/{}/conda'.format(getuser())
return join(root_env, '.pkgs', 'python-3.4.3-0', 'include', 'python3.4m')
def get_ext_modules(use_cython=USE_CYTHON):
global cmdclass
python_header_dir = get_python_header_dir()
if use_cython:
try:
from Cython.Distutils import build_ext
except ImportError:
stderr.write('\"cython\" is not installed. Forcing \"USE_CYTHON\" '
'to \"False\" in order to install.\n')
use_cython = False
if use_cython:
ext_modules = [Extension('src.features',
['src/features.pyx'],
include_dirs=[python_header_dir]),
Extension('src.experiments',
['src/experiments.pyx'],
include_dirs=[python_header_dir]),
Extension('src.datasets',
['src/datasets.pyx'],
include_dirs=[python_header_dir]),
Extension('src.mongodb',
['src/mongodb.pyx'],
include_dirs=[python_header_dir])]
cmdclass.update({'build_ext': build_ext})
return ext_modules
ext_modules = [Extension('src.features',
['src/features.c'],
include_dirs=[python_header_dir]),
Extension('src.experiments',
['src/experiments.pyx'],
include_dirs=[python_header_dir]),
Extension('src.datasets',
['src/datasets.c'],
include_dirs=[python_header_dir]),
Extension('src.mongodb',
['src/mongodb.c'],
include_dirs=[python_header_dir])]
return ext_modules
setup(name='Reviewer Experience Prediction',
description='Repository developed for graduate research at Montclair '
'State University as part of the Applied Linguistics '
'program. The main idea is to use video game reviews '
'coupled with the amount of hours the reviewers played '
'(available through the Steam website) to build models of '
'reviewer experience. The original inspiration developed '
'during a deception detection class, the connection being '
'that experience is related to the truth: If a reviewer '
'truly lacks experience of a game, then their review '
'(whether it is intended to deceive or not) might betray '
'signs of that lack of experience.',
url='https://github.com/mulhod/reviewer_experience_prediction',
long_description=readme(),
version='0.1',
author='Matt Mulholland et al.',
author_email='[email protected]',
setup_requires=['numpy'],
install_requires=reqs(),
packages=['data', 'src', 'util', 'tests'],
package_data={'data': ['*.jsonlines']},
include_package_data=True,
ext_modules=get_ext_modules(),
cmdclass=cmdclass,
scripts=['setup.sh', 'util/get_review_data_all_games.sh'],
entry_points={
'console_scripts':
['extract_features = util.extract_features:main',
'cv_learn = util.cv_learn:main',
'get_review_data = util.get_review_data:main',
'make_arff_files = util.make_arff_files:main',
'make_train_test_sets = util.make_train_test_sets:main',
'create_mongodb_index = util.create_mongodb_index:main']},
keywords='nlp machine learning video game review steam',
license='MIT',
classifiers=['Development Status :: 3 - Alpha',
'Natural Language :: English',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.4',
'Topic :: Scientific/Engineering',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS'],
test_suite='nose2.collector.collector',
zip_safe=False)