-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·86 lines (77 loc) · 2.94 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
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
from setuptools.command.bdist_egg import bdist_egg
from setuptools.command.egg_info import egg_info
from setuptools.command.build_py import build_py
from subprocess import check_call
import sys
import os
def enable_visual_interface():
check_call(f"{sys.executable} -m pip install jupyter", shell=True)
import notebook
notebook.nbextensions.install_nbextension_python(
"checklist.viewer", user=True, overwrite=True, symlink=True)
notebook.nbextensions.enable_nbextension_python(
"checklist.viewer")
def enable_visual_interface_shell_cmd(direction):
sys.path.append(direction)
enable_visual_interface()
#"""
class PostDevelopCommand(develop):
"""Pre-installation for development mode."""
def run(self):
develop.run(self)
#enable_visual_interface()
self.execute(enable_visual_interface_shell_cmd, (self.install_lib,), msg="Running post install task")
class BdistEggCommand(bdist_egg):
def run(self):
bdist_egg.run(self)
enable_visual_interface()
#self.execute(enable_visual_interface_shell_cmd, (self.install_lib,), msg=f"Running post install task on {sys.executable}")
class BuildPyCommand(build_py):
def run(self):
build_py.run(self)
enable_visual_interface()
#self.execute(enable_visual_interface_shell_cmd, (self.install_lib,), msg="Running post install task")
class PostInstallCommand(install):
def run(self):
#super().do_egg_install()
install.run(self)
self.execute(enable_visual_interface_shell_cmd, (self.install_lib,), msg="Running post install task")
#enable_visual_interface()
class EggInfoCommand(egg_info):
def run(self):
egg_info.run(self)
enable_visual_interface()
#self.execute(enable_visual_interface_shell_cmd, (self.install_lib,), msg="Running post install task")
setup(name='checklist',
version='0.0.4',
description='Beyond Accuracy: Behavioral Testing of NLP Models with CheckList',
url='http://github.com/marcotcr/checklist',
author='Marco Tulio Ribeiro',
author_email='[email protected]',
license='MIT',
packages= find_packages(exclude=['js', 'node_modules', 'tests']),
install_requires=[
'numpy>=1.18',
'spacy>=2.2',
'munch>=2.5',
'dill>=0.3.1',
'jupyter>=1.0',
'ipywidgets>=7.5',
'transformers>=2.8',
'pattern>=3.6',
'iso-639'
],
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
'bdist_egg': BdistEggCommand,
'egg_info': EggInfoCommand,
'build_py': BuildPyCommand,
},
package_data={'viewer':['static/*'], "data": ["*"], 'checklist': ['data/*', 'data/lexicons/*', 'viewer/static/*']},
#include_package_data=True,
zip_safe=False
)