-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
67 lines (54 loc) · 2.03 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
from __future__ import print_function
import os
import subprocess
from distutils.command.build import build as distutils_build
from setuptools import setup, find_packages, Command as SetupToolsCommand
VERSION = '1.0.0'
with open('requirements.txt', 'r') as f:
install_requires = f.readlines()
CUSTOM_COMMANDS = [
['pip', 'install', 'spacy==2.2.4'],
['python', '-m', 'spacy', 'download', 'en'],
]
class Build(distutils_build):
sub_commands = distutils_build.sub_commands + [('CustomCommands', None)]
class CustomCommands(SetupToolsCommand):
def initialize_options(self):
pass
def finalize_options(self):
pass
@staticmethod
def run_custom_command(command_list):
print('Running: %s' % command_list)
p = subprocess.Popen(command_list, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout_data, _ = p.communicate()
print('Output: %s' % stdout_data)
if p.returncode != 0:
raise RuntimeError('Command %s failed: exit code: %s' % (command_list, p.returncode))
def run(self):
for command in CUSTOM_COMMANDS:
self.run_custom_command(command)
setup(name='ConTEXT-Explorer',
description='ConTEXT Explorer is an open Web-based system for exploring and visualizing concepts (combinations of occurring words and phrases) over time in the text documents.',
url='https://github.com/alicia-ziying-yang/conTEXT-explorer',
author='Ziying Yang',
author_email='ziying.yang@unimelb.edu.au',
version=VERSION,
license='Apache License 2.0',
packages=['.','whoosh_search','topic_model'],#find_packages(),
package_dir={'.': '.', 'whoosh_search':'whoosh_search',
'topic_model':'topic_model'},
include_package_data=True,
python_requires='==3.7.5',
install_requires=install_requires,
extras_require={},
entry_points = {
"console_scripts": [
"start-ce = app:start_app"
]
},
cmdclass={
'build': Build,
'CustomCommands': CustomCommands,
})