forked from holoviz/colorcet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
119 lines (105 loc) · 3.34 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
import os
import sys
import shutil
from setuptools import setup, find_packages
import pyct.build
def get_setup_version(reponame):
"""
Helper to get the current version from either git describe or the
.version file (if available).
"""
import json
basepath = os.path.split(__file__)[0]
version_file_path = os.path.join(basepath, reponame, '.version')
try:
from param import version
except:
version = None
if version is not None:
return version.Version.setup_version(basepath, reponame, archive_commit="$Format:%h$")
else:
print("WARNING: param>=1.6.0 unavailable. If you are installing a package, this warning can safely be ignored. If you are creating a package or otherwise operating in a git repository, you should install param>=1.6.0.")
return json.load(open(version_file_path, 'r'))['version_string']
########## dependencies ##########
install_requires = [
'param >=1.7.0',
'pyct >=0.4.4',
]
examples = [
'numpy',
'holoviews',
'matplotlib',
'bokeh',
]
tests = [
'flake8',
'nbsmoke >=0.2.6',
'pytest >=2.8.5',
]
extras_require = {
'tests': tests,
'examples': examples,
'doc': examples + [
'nbsite >=0.6.1',
'sphinx_holoviz_theme',
],
'tests_extra': tests + [
'pytest-mpl' # only available on pip and conda-forge
],
# until pyproject.toml/equivalent is widely supported (setup_requires
# doesn't work well with pip)
'build': [
'param >=1.7.0',
'pyct >=0.4.4',
'setuptools >=30.3.0',
'wheel',
]
}
extras_require['all'] = sorted(set(sum(extras_require.values(), [])))
setup_args = dict(
name='colorcet',
description='Collection of perceptually uniform colormaps',
version=get_setup_version('colorcet'),
long_description='README.md',
long_description_type='text/markdown',
license_file='LICENSE.txt',
license='CC-BY License',
classifiers=[
"License :: OSI Approved",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Development Status :: 5 - Production/Stable",
],
author="James A. Bednar",
author_email="[email protected]",
maintainer="James A. Bednar",
maintainer_email="[email protected]",
url="https://colorcet.holoviz.org",
project_urls = {
"Bug Tracker": "http://github.com/holoviz/colorcet/issues",
"Documentation": "https://colorcet.holoviz.org",
"Source Code": "http://github.com/holoviz/colorcet",
},
include_package_data=True,
packages=find_packages(),
python_requires=">=2.7",
install_requires=install_requires,
extras_require=extras_require,
entry_points={
'console_scripts': [
'colorcet = colorcet.__main__:main'
]
},
)
if __name__=="__main__":
example_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'colorcet','examples')
if 'develop' not in sys.argv:
pyct.build.examples(example_path, __file__, force=True)
setup(**setup_args)
if os.path.isdir(example_path):
shutil.rmtree(example_path)