forked from asreview/asreview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
176 lines (155 loc) · 6.12 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Copyright 2019 The ASReview Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# based on https://github.com/pypa/sampleproject - MIT License
# Always prefer setuptools over distutils
import re
import subprocess
from io import open
from os import path
from setuptools import setup
from setuptools import find_packages
from setuptools import Command
import versioneer
def get_long_description():
"""Get project description based on README."""
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# remove emoji
long_description = re.sub(r"\:[a-z_]+\:", "", long_description)
return long_description
DEPS = {
"sbert": ['sentence_transformers'],
"doc2vec": ['gensim<=3.8.2'],
"tensorflow": ['tensorflow'],
"dev": ['check-manifest'],
'test': ['coverage', 'pytest'],
}
DEPS['all'] = DEPS['sbert'] + DEPS['doc2vec'] + DEPS['dev']
DEPS['all'] += DEPS['tensorflow']
class CompileAssets(Command):
"""
Compile and build the frontend assets using npm and webpack.
Registered as cmdclass in setup() so it can be called with
``python setup.py compile_assets``.
"""
description = "Compile and build the frontend assets"
user_options = []
def initialize_options(self):
"""Set default values for options."""
def finalize_options(self):
"""Set final values for options."""
def run(self):
"""Run a command to compile and build assets."""
subprocess.check_call('sh ./asreview/webapp/compile_assets.sh',
shell=True)
def get_cmdclass():
cmdclass = versioneer.get_cmdclass()
cmdclass["compile_assets"] = CompileAssets
return cmdclass
setup(
name='asreview',
version=versioneer.get_version(),
cmdclass=get_cmdclass(),
description='Active learning for Systematic Reviews',
long_description=get_long_description(),
long_description_content_type='text/markdown',
url='https://github.com/asreview/asreview',
author='ASReview Core Development Team',
author_email='[email protected]',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
keywords='systematic review',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
package_data={'asreview': [
'webapp/build/*',
'webapp/build/static/*/*',
]},
python_requires='~=3.6',
install_requires=[
'numpy',
'sklearn',
'pandas',
'rispy',
'dill',
'h5py',
'xlrd>=1.0.0',
'setuptools',
'flask',
'flask_cors',
'openpyxl',
],
extras_require=DEPS,
entry_points={
'console_scripts': [
'asreview=asreview.__main__:main',
],
'asreview.entry_points': [
'lab=asreview.entry_points:LABEntryPoint',
'oracle=asreview.entry_points:OracleEntryPoint', # deprecated (use lab)
'web_run_model = asreview.entry_points:WebRunModelEntryPoint',
'simulate=asreview.entry_points:SimulateEntryPoint',
'simulate-batch = asreview.entry_points:BatchEntryPoint',
'algorithms = asreview.entry_points:AlgorithmsEntryPoint',
],
'asreview.readers': [
'.csv = asreview.io.csv_reader:read_csv',
'.ris = asreview.io.ris_reader:read_ris',
'.txt = asreview.io.ris_reader:read_ris',
'.xlsx = asreview.io.excel_reader:read_excel',
'.xml = asreview.io.pubmed_xml_reader: read_pubmed_xml',
],
'asreview.datasets': [
'builtin = asreview.datasets:BuiltinDataGroup',
],
'asreview.models': [
'svm = asreview.models.svm:SVMModel',
'nb = asreview.models.nb:NBModel',
'rf = asreview.models.rf:RFModel',
'nn-2-layer = asreview.models.nn_2_layer:NN2LayerModel',
'logistic = asreview.models.logistic:LogisticModel',
'lstm-base = asreview.models.lstm_base:LSTMBaseModel',
'lstm-pool = asreview.models.lstm_pool:LSTMPoolModel',
],
'asreview.feature_extraction': [
'doc2vec = asreview.feature_extraction.doc2vec:Doc2Vec',
'embedding-idf = asreview.feature_extraction.embedding_idf:EmbeddingIdf', # noqa
'embedding-lstm = asreview.feature_extraction.embedding_lstm:EmbeddingLSTM', # noqa
'sbert = asreview.feature_extraction.sbert:SBERT',
'tfidf = asreview.feature_extraction.tfidf:Tfidf',
],
'asreview.balance_strategy': [
"simple = asreview.balance_strategies.simple:SimpleBalance",
"double = asreview.balance_strategies.double:DoubleBalance",
"triple = asreview.balance_strategies.triple:TripleBalance",
"undersample = asreview.balance_strategies.undersample:UndersampleBalance", # noqa
],
'asreview.query_strategy': [
"max = asreview.query_strategies.max:MaxQuery",
"random = asreview.query_strategies.random:RandomQuery",
"uncertainty = asreview.query_strategies.uncertainty:UncertaintyQuery", # noqa
"cluster = asreview.query_strategies.cluster:ClusterQuery",
]
},
project_urls={
'Bug Reports': 'https://github.com/asreview/asreview/issues',
'Source': 'https://github.com/asreview/asreview/',
},
)