forked from jupyter/declarativewidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
59 lines (48 loc) · 1.72 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
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import sys
from setuptools import setup, find_packages
# Get location of this file at runtime
HERE = os.path.abspath(os.path.dirname(__file__))
# Eval the version tuple and string from the source
VERSION_NS = {}
with open(os.path.join(HERE, 'urth/widgets/ext/_version.py')) as f:
exec(f.read(), {}, VERSION_NS)
VERSION_FILE = os.path.join(HERE, 'VERSION')
# Apply version to build
if os.path.isfile(VERSION_FILE):
# CI build, read metadata and append
with open(VERSION_FILE, 'r') as fh:
BUILD_INFO = fh.readline().strip()
fh.close()
with open(VERSION_FILE, 'w') as fh:
fh.write(VERSION_NS['__version__'] + '\n')
fh.write(BUILD_INFO + '\n')
fh.close()
setup_args = dict(
name='jupyter_declarativewidgets',
author='Jupyter Development Team',
author_email='[email protected]',
description='Jupyter extensions for supporting declarative widgets',
url='https://github.com/jupyter-incubator/declarativewidgets',
version=VERSION_NS['__version__'],
license='BDS',
platforms=['Jupyter Notebook 4.0.x'],
packages=find_packages(),
include_package_data=True,
scripts=[
'scripts/jupyter-declarativewidgets'
]
)
if 'setuptools' in sys.modules:
# setupstools turns entrypoint scripts into executables on windows
setup_args['entry_points'] = {
'console_scripts': [
'jupyter-declarativewidgets = declarativewidgets.extensionapp:main'
]
}
# Don't bother installing the .py scripts if if we're using entrypoints
setup_args.pop('scripts', None)
if __name__ == '__main__':
setup(**setup_args)