forked from aws/graph-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
102 lines (91 loc) · 3.07 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
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
from os.path import join as pjoin
from setuptools import setup, find_packages
from setupbase import (
create_cmdclass, install_npm, ensure_targets,
combine_commands, HERE, widgets_root
)
nb_path = pjoin(HERE, 'src', 'graph_notebook', 'widgets', 'nbextension', 'static')
lab_path = pjoin(HERE, 'src', 'graph_notebook', 'widgets', 'labextension')
js_targets = [
pjoin(nb_path, 'index.js'),
pjoin(HERE, 'src', 'graph_notebook', 'widgets', 'lib', 'plugin.d.ts')
]
package_data_spec = {
'graph_notebook_widgets': [
'nbextension/static/*.*js*',
'labextension/*.tgz'
]
}
data_files_spec = [
('share/jupyter/nbextensions/graph_notebook_widgets',
nb_path, '*.js*'),
('share/jupyter/lab/extensions', lab_path, '*.tgz'),
('etc/jupyter/nbconfig/notebook.d', HERE, 'graph_notebook_widgets.json')
]
cmd_class = create_cmdclass('jsdeps', package_data_spec=package_data_spec, data_files_spec=data_files_spec)
cmd_class['jsdeps'] = combine_commands(
install_npm(widgets_root, build_cmd='build:all'),
ensure_targets(js_targets),
)
def get_version():
with open('src/graph_notebook/__init__.py') as f:
for line in f:
if line.startswith('__version__'):
_, _, version = line.replace("'", '').split()
break
if version == '':
raise ValueError('no version found')
return version
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='graph-notebook',
author='amazon-neptune',
author_email='[email protected]',
description='jupyter notebook extension to connect to graph databases',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/aws/graph-notebook',
version=get_version(),
packages=find_packages(where='src', exclude=('test',)),
package_dir={'': 'src'},
include_package_data=True,
install_requires=[
'gremlinpython<3.5.*',
'SPARQLWrapper==1.8.4',
'tornado==4.5.3',
'requests',
'ipywidgets',
'networkx==2.4',
'Jinja2==2.11.3',
'notebook',
'jupyter-contrib-nbextensions',
'widgetsnbextension',
'jupyter>=1.0.0',
'requests-aws4auth==1.0.1',
'botocore>=1.19.37',
'boto3>=1.17.58',
'ipython>=7.16.1',
'neo4j==4.3.2',
'rdflib==5.0.0'
],
package_data={
'graph_notebook': ['graph_notebook/widgets/nbextensions/static/*.js',
'graph_notebook/widgets/labextension/*.tgz'],
'': ['*.ipynb', '*.html', '*.css', '*.js', '*.txt', '*.json', '*.ts', '*.css', '*.yaml', '*.md', '*.tgz']
},
cmdclass=cmd_class,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License'
],
keywords='jupyter neptune gremlin sparql',
tests_require=[
'pytest'
]
)