forked from ParallelSSH/ssh2-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (72 loc) · 2.22 KB
/
setup.py
File metadata and controls
79 lines (72 loc) · 2.22 KB
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
from __future__ import print_function
import platform
import os
import sys
from glob import glob
from multiprocessing import cpu_count
# import versioneer
from setuptools import setup, find_packages, Extension
cpython = platform.python_implementation() == 'CPython'
try:
from Cython.Build import cythonize
except ImportError:
USING_CYTHON = False
else:
USING_CYTHON = True
ext = 'pyx' if USING_CYTHON else 'c'
sources = ['ssh2/*.%s' % (ext,)]
_libs = ['ssh2']
_comp_args = ["-ggdb"] # , "-O3"]
if USING_CYTHON:
extensions = [
Extension('ssh2/*',
sources=sources,
libraries=_libs,
extra_compile_args=_comp_args,
# For conditional compilation
# pyrex_compile_time_env
)
]
extensions = cythonize(
extensions,
compiler_directives={'embedsignature': True,
'optimize.use_switch': True,
'boundscheck': False,
'wraparound': False,
},
nthreads=cpu_count())
else:
sources = glob(sources[0])
extensions = [
Extension(sources[i].split('.')[0].replace('/', '.'),
sources=[sources[i]],
libraries=_libs,
extra_compile_args=_comp_args,
# For conditional compilation
# pyrex_compile_time_env
)
for i in range(len(sources))]
setup(
name='ssh2-python',
# version=versioneer.get_version(),
version='0.2.1',
url='https://github.com/ParallelSSH/ssh2-python',
license='LGPLv2',
author='Panos Kittenis',
author_email='22e889d8@opayq.com',
description=('Python bindings for libssh2 based on Cython'),
long_description=open('README.rst').read(),
packages=find_packages('.'),
zip_safe=False,
include_package_data=True,
platforms='any',
classifiers=[
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
ext_modules=extensions,
package_data={'ssh2': ['*.pxd']},
)