forked from udgover/PyEasyArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
55 lines (45 loc) · 1.54 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
import setuptools
import setuptools.command.install
import os.path
def _pre_install():
print("Verifying that the library is accessible.")
try:
import libarchive.library
except OSError as e:
print("Library can not be loaded: %s" % (str(e)))
raise
class _custom_install(setuptools.command.install.install):
def run(self):
_pre_install()
setuptools.command.install.install.run(self)
import libarchive
app_path = os.path.dirname(libarchive.__file__)
with open(os.path.join(app_path, 'resources', 'README.md')) as f:
long_description = f.read()
with open(os.path.join(app_path, 'resources', 'requirements.txt')) as f:
install_requires = list(map(lambda s: s.strip(), f))
description = "Python adapter for universal, libarchive-based archive access."
setuptools.setup(
name='libarchive',
version=libarchive.__version__,
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
classifiers=[],
keywords='archive libarchive 7z tar bz2 zip gz',
author='Dustin Oprea',
author_email='myselfasunder@gmail.com',
url='https://github.com/dsoprea/PyEasyArchive',
license='GPL 2',
packages=setuptools.find_packages(exclude=['dev', 'tests']),
include_package_data=True,
zip_safe=False,
package_data={
'libarchive': [
'resources/README.md',
'resources/requirements.txt',
],
},
install_requires=install_requires,
cmdclass={ 'install': _custom_install }
)