forked from matplotlib/ipympl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
106 lines (94 loc) · 2.81 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
import os
from distutils import log
from os.path import join as pjoin
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_targets,
get_version,
install_npm,
skip_if_exists,
)
from setuptools import find_packages, setup
# Name of the project
name = 'ipympl'
HERE = os.path.dirname(os.path.abspath(__file__))
long_description = 'Matplotlib Jupyter Extension'
log.info('setup.py entered')
log.info('$PATH=%s' % os.environ['PATH'])
# Get ipympl version
version = get_version(os.path.join(name, '_version.py'))
js_dir = os.path.join(HERE, 'js')
# Representative files that should exist after a successful build
jstargets = [
pjoin(HERE, name, 'nbextension', 'index.js'),
pjoin(HERE, 'lib', 'plugin.js'),
]
data_files_spec = [
('share/jupyter/nbextensions/jupyter-matplotlib', 'ipympl/nbextension', '**'),
('share/jupyter/labextensions/jupyter-matplotlib', 'ipympl/labextension', "**"),
('etc/jupyter/nbconfig/notebook.d', '.', 'jupyter-matplotlib.json'),
]
cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec)
js_command = combine_commands(
install_npm(HERE, npm=['yarn'], build_cmd='build:prod'),
ensure_targets(jstargets),
)
is_repo = os.path.exists(os.path.join(HERE, '.git'))
if is_repo:
cmdclass['jsdeps'] = js_command
else:
cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command)
setup_args = dict(
name=name,
version=version,
description='Matplotlib Jupyter Extension',
long_description=long_description,
license='BSD License',
include_package_data=True,
install_requires=[
'ipython<9',
'numpy',
'ipython_genutils',
'pillow',
'traitlets<6',
'ipywidgets>=7.6.0,<9',
'matplotlib>=3.4.0,<4',
],
extras_require={
"docs": [
"myst-nb",
"Sphinx >= 1.5",
"sphinx-copybutton",
"sphinx-thebe",
"sphinx-togglebutton",
"sphinx-book-theme",
]
},
packages=find_packages(),
zip_safe=False,
cmdclass=cmdclass,
author='Matplotlib Development Team',
author_email='[email protected]',
url='http://matplotlib.org',
keywords=[
'ipython',
'jupyter',
'widgets',
'graphics',
],
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: IPython',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Multimedia :: Graphics',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
)
setup(**setup_args)