-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
112 lines (99 loc) · 3.57 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
from setuptools import setup, find_packages, Command
from setuptools.command.build_py import build_py as _build_py
from distutils.spawn import find_executable
from lacli import __version__
import os
class gen_thrift(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
thrift = find_executable('thrift')
if thrift is not None:
root = os.path.abspath(os.path.dirname(__file__))
out = os.path.join(root, 'lacli', 'server', 'interface')
self.mkpath(out)
self.announce("thrift found, regenerating files in " + out)
thriftfile = os.path.join(
root, 'lacli', 'server', 'ClientInterface.thrift')
if not self.dry_run:
self.spawn([thrift, '-out', out, '-v',
'--gen', 'py:twisted,new_style', thriftfile])
else:
self.warn("thrift executable not found, skipping")
try:
import pandoc
pandoc.core.PANDOC_PATH = 'pandoc'
readme = pandoc.Document()
readme.markdown = open('README.md').read()
description = readme.rst
except (IOError, ImportError):
description = 'This is the prototype client program' + \
'for interacting with the Longaccess service.'
class build_py(_build_py):
def thrift_gen(self, files):
pass
def run(self):
_build_py.run_command(self, 'gen_thrift')
_build_py.run(self)
def pep386adapt(version):
if version is not None and '-' in version:
# adapt git-describe version to be in line with PEP 386
parts = version.split('-')
parts[-2] = 'post'+parts[-2]
version = '.'.join(parts[:-1])
return version
setup(version=pep386adapt(__version__),
name="lacli",
author="Konstantinos Koukopoulos",
author_email='[email protected]',
description="The Long Access client",
long_description=description,
url='http://github.com/longaccess/longaccess-client/',
license='Apache',
packages=find_packages(exclude=['features*', '*.t']),
install_requires=[
'boto>=2.14, <3',
'python-dateutil>=2.1, <3',
'filechunkio>=1.5',
'docopt>=0.6.1, <0.7',
'progressbar>=2.3, <3',
'logutils>=0.3.3, <0.4',
'requests>=2.0.0, <3',
'pycrypto>=2.6, <2.7',
'pyaml>=13.07, <14',
'Twisted>=13.2, <14',
'crochet>=1.0.0, <2',
'treq>=0.2.0, <0.3',
'pyOpenSSL>=0.13, <1',
'thrift>=0.9, <1',
'blessed>=1.8.3, <2',
'lacore>=0.1.3.1, <2',
'psutil>=2.1, <3'
],
tests_require=['testtools'],
test_suite="lacli.t",
entry_points="""
[console_scripts]
lacli = lacli.main:main
""",
cmdclass={'build_py': build_py, 'gen_thrift': gen_thrift},
package_data={'lacli': ['data/certificate.html']},
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Intended Audience :: Information Technology',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: System :: Archiving',
'Topic :: Utilities',
],
)