forked from kentfrazier/Exhibitionist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
150 lines (128 loc) · 4.86 KB
/
setup.py
File metadata and controls
150 lines (128 loc) · 4.86 KB
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
from __future__ import print_function
# Parts purloined from pandas and IPython's setup.py
from setuptools import setup, find_packages
import sys
import shutil
import os
if sys.version_info[:2] < (2,6):
sys.stderr.write("Python >= 2.6 required")
sys.exit(1)
PY3 = (sys.version_info[0] >= 3)
DISTNAME = 'pandas'
LICENSE = 'BSD'
AUTHOR = "Yoval P."
URL = "http://github.com/Exhibitionist/Exhibitionist"
DOWNLOAD_URL = ''
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
]
MAJOR = 0
MINOR = 1
MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''
FULLVERSION = VERSION
DESCRIPTION="Build a mini web-app to replace your object's repr() with an HTML+JS view"
LONG_DESCRIPTION="""
Exhibitionist is a Python library that let's you build tiny web-apps which serve as
views for live python objects in your favorite python shell.
It's built on top of [Tornado](http://www.tornadoweb.org/) and is easy to get started with, the "hello world"
example takes about 10 lines.
If you want to create fully interactive views of python objects using HTML and
leveraging javascript libraries such as [d3.js](http://d3js.org) or your favorite grid/charting
library, exhibitionist allows you to do that with very little boilerplate in a way that closely
follows modern web app development practices,
in both spirit and process.
The resulting views are available as urls served from a local server and are viewable directly in the browser. Users of [IPython-notebook](http://gituhb.com/ipython/ipython ) can leverage it's inline display of HTML+Javascript for seamless integration of views into their interactive workflow.
*Features:*
- Out-of-the-box support for two-way message passing between javascript and python using a PubSub mechanism mechanism built on websockets.
- use AJAX to dynamically load data, work with large data sets, make things
interactive. do server things on the server and client things on the client.
- Designed to be a dependency of you library. import it and integrate HTML
views of you classes into your code. or monkey-patch an existing library
with your own UI. It's all good.
- Develop views with your favorite HTML/JS/CSS libraries. Everything is supported.
- Examples included as well as a heavily documented skeleton project to get you started.
- Supports Python 2.6+, 3.2+.
- Test-suite. Coverage. yep
- BSD-licensed, go crazy.
- Repo available on github: [http://github.com/Exhibitionist/Exhibitionist](http://github.com/Exhibitionist/Exhibitionist)
"""
if not ISRELEASED:
FULLVERSION += '.dev'
try:
import subprocess
try:
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE).stdout
except OSError:
# msysgit compatibility
pipe = subprocess.Popen(
["git.cmd", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE).stdout
rev = pipe.read().strip().decode('ascii')
FULLVERSION += "-%s" % rev
except:
raise Exception("WARNING: Couldn't get git revision")
else:
FULLVERSION += QUALIFIER
def cleanup():
"""Clean up the junk left around by the build process"""
if "develop" not in sys.argv and "egg_info" not in sys.argv:
try:
shutil.rmtree('Exhibitionist.egg-info') # if it's a dir
os.unlink('Exhibitionist.egg-info') # if it's a link
except:
pass
def write_version_py(filename=None):
cnt = """\
version = '%s'
short_version = '%s'
"""
if not filename:
filename = os.path.join(
os.path.dirname(__file__), 'exhibitionist', 'version.py')
a = open(filename, 'w')
try:
a.write(cnt % (FULLVERSION, VERSION))
finally:
a.close()
setup_args=dict(
name='Exhibitionist',
version=VERSION,
author='y-p',
maintainer_email='Issues@at.github',
packages = find_packages(exclude=['Examples']),
package_data={'exhibitionist': ['static/*.*']},
url='http://www.github.com/y-p/Exhibitionist',
license='LICENSE.txt',
description=DESCRIPTION,
tests_require=['nose',
'coverage',
'ws4py>=0.2.4', # for websockets
'requests>=1.0', # for HTTP
#'grequests', # for parallel HTTP
],
test_suite='nose.collector',
long_description=LONG_DESCRIPTION,
install_requires = ['tornado>=2.4.1', 'six'],
extras_require = dict(
doc = 'Sphinx>=0.3',
test = 'nose>=1.0',
)
)
write_version_py() # generate exhibition/version.py
def main():
setup(**setup_args)
try:
cleanup()
except:
pass
if __name__ == '__main__':
main()