-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·85 lines (75 loc) · 2.84 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import re
import os
import glob
import sys
scripts = glob.glob('shellcmds/*')
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)
version = get_version('lib/JumpScale')
def clean():
print "CLEAN"
for r,d,f in os.walk("/usr"):
for path in f:
match=False
if path.startswith("jscode") or path.startswith("ays") or path.startswith("jsdevelop")\
or path.startswith("jsreinstall") or path.startswith("jsprocess") or path.startswith("jslog") or path.startswith("jsshell") or path.startswith("osis"):
match=True
if path in ["js"]:
match=True
if match:
print "remove:%s" % os.path.join(r,path)
os.remove(os.path.join(r,path))
cmds="""
killall tmux
rm -rf /usr/local/lib/python2.7/dist-packages/jumpscale*
rm -rf /usr/local/lib/python2.7/site-packages/jumpscale*
rm -rf /usr/local/lib/python2.7/dist-packages/JumpScale*
rm -rf /usr/local/lib/python2.7/site-packages/JumpScale*
rm -rf /usr/local/lib/python2.7/site-packages/JumpScale/
rm -rf /usr/local/lib/python2.7/site-packages/jumpscale/
rm -rf /usr/local/lib/python2.7/dist-packages/JumpScale/
rm -rf /usr/local/lib/python2.7/dist-packages/jumpscale/
rm /usr/local/bin/js*
rm /usr/local/bin/ays*
"""
for cmd in cmds.split("\n"):
if cmd.strip()<>"":
rc=os.system("%s 2>&1 > /dev/null; echo"%cmd)
clean()
def list_files(basedir='.', subdir='.'):
package_data = []
basedir_length = len(basedir)
for dirpath, dirs, files in os.walk(os.path.join(basedir,subdir)):
for file in files:
package_data.append(os.path.join(dirpath[basedir_length+1:],file))
return package_data
setup(name='JumpScale-core',
version=version,
description='Python Automation framework',
author='JumpScale',
author_email='[email protected]',
url='http://www.jumpscale.org',
license='BSD 2-Clause',
packages = find_packages('lib'),
package_dir = {'':'lib'},
include_package_data = True,
package_data = {'JumpScale':list_files(basedir='lib/JumpScale',subdir='core/_defaultcontent') +
list_files(basedir='lib/JumpScale',subdir='baselib/atyourservice/templates')
},
scripts=scripts,
download_url='http://pypi.python.org/pypi/JumpScale/',
install_requires=[],
classifiers=[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'License :: OSI Approved :: BSD License',
]
)