-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
57 lines (49 loc) · 1.49 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
# coding=utf-8
import os
import sys
import subprocess
from distutils.core import setup
from distutils.command.install_scripts import install_scripts
try:
import py2exe
except:
py2exe = None
class my_install_scripts(install_scripts):
def run(self):
install_scripts.run(self)
if sys.platform == 'win32':
try:
script_dir = os.path.join(sys.prefix, 'Scripts')
script_path = os.path.join(script_dir, 'bomb')
bat_str = '@"%s" "%s" %%*' % (sys.executable, script_path)
bat_path = os.path.join(self.install_dir, 'bomb.bat')
with open(bat_path, 'w') as handler:
handler.write(bat_str)
print(('Created: %s' % bat_path))
except:
print(('ERROR: Unable to create %s: %s' % (bat_path, err)))
try:
with open(root_dir + os.sep + 'README.md') as handler:
long_description = handler.read()
except:
long_description = ''
setup(
name='bomb',
version='1.0.2',
description='Web frond-end publish tools',
long_description=long_description,
author='dexbol',
author_email='dexbolg@gmail.com',
url='https://github.com/dexbol/bomb',
packages=['bomb'],
package_data={'bomb': ['jar/*.jar']},
include_package_data=True,
scripts=['bin/bomb'],
cmdclass={'install_scripts':my_install_scripts},
console=['bin/bomb'],
options={
"py2exe": {
"skip_archive": True
}
}
)