forked from holoviz/holoviews
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
184 lines (158 loc) · 6.77 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
177
178
179
180
181
182
183
184
#!/usr/bin/env python
import sys, os, glob
import shutil
from collections import defaultdict
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup_args = {}
install_requires = ['param>=1.5.1,<2.0', 'numpy>=1.0']
extras_require={}
# Notebook dependencies of IPython 3
extras_require['notebook-dependencies'] = ['ipython', 'pyzmq', 'jinja2', 'tornado',
'jsonschema', 'notebook', 'pygments']
# IPython Notebook + matplotlib
extras_require['recommended'] = extras_require['notebook-dependencies'] + ['matplotlib']
# Additional, useful third-party packages
extras_require['extras'] = (['pandas', 'seaborn', 'bokeh==0.12.13']
+ extras_require['recommended'])
# Everything including cyordereddict (optimization) and nosetests
extras_require['all'] = (extras_require['recommended']
+ extras_require['extras']
+ ['cyordereddict', 'nose'])
PYPI_BLURB="""
HoloViews is designed to make data analysis and visualization seamless and simple. With HoloViews, you can usually express what you want to do in very few lines of code, letting you focus on what you are trying to explore and convey, not on the process of plotting.
Check out the `HoloViews web site <http://holoviews.org>`_ for extensive examples and documentation.
"""
setup_args.update(dict(
name='holoviews',
version="1.9.2",
install_requires = install_requires,
extras_require = extras_require,
description='Stop plotting your data - annotate your data and let it visualize itself.',
long_description=PYPI_BLURB,
author= "Jean-Luc Stevens and Philipp Rudiger",
author_email= "[email protected]",
maintainer= "IOAM",
maintainer_email= "[email protected]",
platforms=['Windows', 'Mac OS X', 'Linux'],
license='BSD',
url='http://www.holoviews.org',
entry_points={
'console_scripts': [
'holoviews = holoviews.util.command:main'
]},
packages = ["holoviews",
"holoviews.core",
"holoviews.core.data",
"holoviews.element",
"holoviews.ipython",
"holoviews.util",
"holoviews.operation",
"holoviews.plotting",
"holoviews.plotting.mpl",
"holoviews.plotting.bokeh",
"holoviews.plotting.plotly",
"holoviews.plotting.widgets"],
package_data={'holoviews.ipython': ['*.html'],
'holoviews.plotting.mpl': ['*.mplstyle', '*.jinja', '*.js'],
'holoviews.plotting.bokeh': ['*.js', '*.css'],
'holoviews.plotting.plotly': ['*.js'],
'holoviews.plotting.widgets': ['*.jinja', '*.js', '*.css']},
classifiers = [
"License :: OSI Approved :: BSD License",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Natural Language :: English",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries"]
))
def check_pseudo_package(path):
"""
Verifies that a fake subpackage path for assets (notebooks, svgs,
pngs etc) both exists and is populated with files.
"""
if not os.path.isdir(path):
raise Exception("Please make sure pseudo-package %s exists." % path)
else:
assets = os.listdir(path)
if len(assets) == 0:
raise Exception("Please make sure pseudo-package %s is populated." % path)
excludes = ['DS_Store', '.log', 'ipynb_checkpoints']
packages = []
extensions = defaultdict(list)
def walker(top, names):
"""
Walks a directory and records all packages and file extensions.
"""
global packages, extensions
if any(exc in top for exc in excludes):
return
package = top[top.rfind('holoviews'):].replace(os.path.sep, '.')
packages.append(package)
for name in names:
ext = '.'.join(name.split('.')[1:])
ext_str = '*.%s' % ext
if ext and ext not in excludes and ext_str not in extensions[package]:
extensions[package].append(ext_str)
# Note: This function should be identical to util.examples
# (unfortunate and unavoidable duplication)
def examples(path='holoviews-examples', verbose=False, force=False, root=__file__):
"""
Copies the notebooks to the supplied path.
"""
filepath = os.path.abspath(os.path.dirname(root))
example_dir = os.path.join(filepath, './examples')
if not os.path.exists(example_dir):
example_dir = os.path.join(filepath, '../examples')
if os.path.exists(path):
if not force:
print('%s directory already exists, either delete it or set the force flag' % path)
return
shutil.rmtree(path)
ignore = shutil.ignore_patterns('.ipynb_checkpoints','*.pyc','*~')
tree_root = os.path.abspath(example_dir)
if os.path.isdir(tree_root):
shutil.copytree(tree_root, path, ignore=ignore, symlinks=True)
else:
print('Cannot find %s' % tree_root)
def package_assets(example_path):
"""
Generates pseudo-packages for the examples directory.
"""
examples(example_path, force=True, root=__file__)
for root, dirs, files in os.walk(example_path):
walker(root, dirs+files)
setup_args['packages'] += packages
for p, exts in extensions.items():
if exts:
setup_args['package_data'][p] = exts
if __name__=="__main__":
example_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'holoviews/examples')
if not 'develop' in sys.argv:
package_assets(example_path)
if ('upload' in sys.argv) or ('sdist' in sys.argv):
import holoviews
holoviews.__version__.verify(setup_args['version'])
if 'install' in sys.argv:
header = "HOLOVIEWS INSTALLATION INFORMATION"
bars = "="*len(header)
extras = '\n'.join('holoviews[%s]' % e for e in setup_args['extras_require'])
print("%s\n%s\n%s" % (bars, header, bars))
print("\nHoloViews supports the following installation types:\n")
print("%s\n" % extras)
print("Users should consider using one of these options.\n")
print("By default only a core installation is performed and ")
print("only the minimal set of dependencies are fetched.\n\n")
print("For more information please visit http://holoviews.org/install.html\n")
print(bars+'\n')
setup(**setup_args)
if os.path.isdir(example_path):
shutil.rmtree(example_path)