forked from zakandrewking/escher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
45 lines (38 loc) · 1.38 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
from sys import argv
from subprocess import call
import threading
import webbrowser
from os.path import join, dirname, realpath
try:
from setuptools import setup
except:
from distutils.core import setup
directory = dirname(realpath(__file__))
version = __import__('escher').__version__
escher = 'escher.%s.js'%version
escher_min = 'escher.%s.min.js'%version
port = 8789
if 'clean' in argv:
call(['rm', join('escher/lib', escher)])
call(['rm', join('escher/lib', escher_min)])
call(['rm', '-r', 'build'])
call(['rm', '-r', 'Escher.egg-info'])
print 'done cleaning'
if 'test' in argv or 'build' in argv or 'jasmine' in argv:
call([join(directory, 'bin/r.js'), '-o', 'escher/js/build/build.js',
'out=escher/lib/%s'%escher, 'optimize=none'])
if 'build' in argv:
call([join(directory, 'bin/r.js'), '-o', 'escher/js/build/build.js',
'out=escher/lib/%s'%escher_min, 'optimize=uglify'])
print 'done building'
setup(name='Escher',
version=version,
author='Zachary King',
url='http://zakandrewking.github.io/escher/',
packages=['escher'],
package_data={'escher': ['css/*', 'templates/*', 'example_data/*',
'lib/*.js', 'lib/*.css', 'lib/fonts/*']})
if 'test' in argv or 'pytest' in argv:
call(['py.test'])
if 'test' in argv or 'jasmine' in argv:
call(['jasmine', '--port=%d' % port])