-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
56 lines (49 loc) · 1.47 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
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
import os
import sys
from distutils.core import setup
import distutils.command.install_scripts
from pymobi import __name__ as __appname__
from pymobi import __version__
from pymobi import __license__
from pymobi import __author__
from pymobi import __email__
class my_install(distutils.command.install_scripts.install_scripts):
""" remove script ext """
def run(self):
distutils.command.install_scripts.install_scripts.run(self)
if sys.platform != 'win32':
for script in self.get_outputs():
if script.endswith(".py"):
new_name = script[:-3]
if os.path.exists(new_name):
os.remove(new_name)
os.rename(script, new_name)
return
with open('README.md') as f:
long_description = f.read()
setup(
name=__appname__,
version=__version__,
author=__author__,
author_email=__email__,
license=__license__,
url='https://github.com/liuyug/pymobi.git',
description='Mobipocket tools',
long_description=long_description,
platforms=['noarch'],
packages=[
'pymobi',
],
package_dir={'pymobi': 'pymobi'},
data_files=[(
'share/pymobi', [
'README.rst',
'MANIFEST.in',
]
)],
scripts=['unpackmobi.py', 'infomobi.py', 'removesrcs.py', 'titlemobi.py'],
cmdclass={"install_scripts": my_install},
requires=['argparse'],
)