-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
53 lines (45 loc) · 1.97 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
# setup.py, config file for distutils
import os
from distutils.command.install_data import install_data
from distutils.core import setup
import UnRAR2
class smart_install_data(install_data):
def run(self):
#need to change self.install_dir to the actual library dir
install_cmd = self.get_finalized_command('install')
self.install_dir = getattr(install_cmd, 'install_lib')
return install_data.run(self)
data_files = []
for dirpath, dirnames, filenames in os.walk(r'.'):
for dirname in ['.svn', 'build', 'dist', '_sgbak', '.hg']:
try:
dirnames.remove(dirname)
except ValueError:
pass
for filename in [fn for fn in filenames if os.path.splitext(fn)[-1].lower() in ('.pyc', '.pyo', '.scc')]:
filenames.remove(filename)
parts = ['UnRAR2']+dirpath.split(os.sep)[1:]
data_files.append((os.path.join(*parts), [os.path.join(dirpath, fn) for fn in filenames]))
setup(name='pyUnRAR2',
version=UnRAR2.__version__,
description='Improved Python wrapper around the free UnRAR.dll',
long_description=UnRAR2.__doc__.strip(),
author='Konstantin Yegupov',
author_email='[email protected]',
url='https://github.com/kyegupov/py-unrar2',
license='MIT',
platforms='Windows',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Win32 (MS Windows)',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Archiving :: Compression',
],
packages=['UnRAR2'],
package_dir={'UnRAR2': 'UnRAR2'},
cmdclass={'install_data': smart_install_data}
)