|
20 | 20 |
|
21 | 21 | _PYTHON_MAJOR_VERSION = int(platform.python_version_tuple()[0]) |
22 | 22 | ON_WINDOWS = platform.system() == 'Windows' |
23 | | -ON_RTD = os.environ.get('READTHEDOCS') == 'True' |
24 | | -SYSTEM_LIBSSH = bool(os.environ.get('SYSTEM_LIBSSH', 0)) or \ |
25 | | - ON_RTD or ON_WINDOWS |
| 23 | +SYSTEM_LIBSSH = bool(os.environ.get('SYSTEM_LIBSSH', 0)) or ON_WINDOWS |
26 | 24 |
|
27 | 25 | if ON_WINDOWS and _PYTHON_MAJOR_VERSION < 3: |
28 | 26 | raise ImportError( |
29 | 27 | "ssh-python requires Python 3 or above on Windows platforms.") |
30 | 28 |
|
| 29 | + |
31 | 30 | # Only build libssh if SYSTEM_LIBSSH is not set and running a build |
32 | 31 | if not SYSTEM_LIBSSH and (len(sys.argv) >= 2 and not ( |
33 | 32 | '--help' in sys.argv[1:] or |
34 | 33 | sys.argv[1] in ( |
35 | 34 | '--help-commands', 'egg_info', '--version', 'clean', |
36 | 35 | 'sdist', '--long-description')) and |
37 | 36 | __name__ == '__main__'): |
| 37 | + sys.stdout.write("SYSTEM_LIBSSH is unset, starting embedded libssh build%s" % (os.linesep,)) |
38 | 38 | build_ssh() |
39 | 39 |
|
40 | 40 | ext = 'pyx' if USING_CYTHON else 'c' |
|
64 | 64 |
|
65 | 65 |
|
66 | 66 | runtime_library_dirs = ["$ORIGIN/."] if not SYSTEM_LIBSSH else None |
67 | | -_lib_dir = os.path.abspath("./local/lib") if not SYSTEM_LIBSSH else "/usr/local/lib" |
68 | | -include_dirs = ["./local/include", "./libssh/include"] if (ON_WINDOWS or ON_RTD) or \ |
69 | | - not SYSTEM_LIBSSH else ["/usr/local/include"] |
| 67 | +lib_dirs = [os.path.abspath("./local/lib")] if not SYSTEM_LIBSSH else ["/usr/local/lib"] |
| 68 | + |
| 69 | +include_dirs = ["./local/include", "./libssh/include"] \ |
| 70 | + if ON_WINDOWS or not SYSTEM_LIBSSH else ["/usr/local/include"] |
70 | 71 |
|
| 72 | +sys.stdout.write("Library dirs: %s, runtime dirs: %s, include: %s%s" % |
| 73 | + (lib_dirs, runtime_library_dirs, include_dirs, os.linesep)) |
71 | 74 | extensions = [ |
72 | 75 | Extension( |
73 | 76 | sources[i].split('.')[0].replace(os.path.sep, '.'), |
74 | 77 | sources=[sources[i]], |
75 | 78 | include_dirs=include_dirs, |
76 | 79 | libraries=_libs, |
77 | | - library_dirs=[_lib_dir], |
| 80 | + library_dirs=lib_dirs, |
78 | 81 | runtime_library_dirs=runtime_library_dirs, |
79 | 82 | extra_compile_args=_comp_args, |
80 | 83 | **cython_args |
|
95 | 98 | sys.stdout.write("Cython arguments: %s%s" % (cython_args, os.linesep)) |
96 | 99 |
|
97 | 100 |
|
98 | | -sys.stdout.write("Windows platform: %s, Python major version: %s.%s" % (ON_WINDOWS, _PYTHON_MAJOR_VERSION, os.sep)) |
99 | | -if ON_WINDOWS and _PYTHON_MAJOR_VERSION == 2: |
100 | | - # Python 2 on Windows builds are unsupported. |
101 | | - extensions = [ |
102 | | - Extension( |
103 | | - 'ssh', |
104 | | - sources=[os.sep.join(['ssh', '__init__.%s' % (ext,)])], |
105 | | - extra_compile_args=_comp_args, |
106 | | - **cython_args |
107 | | - ) |
108 | | - ] |
109 | | - package_data = {} |
110 | | - sys.stdout.write("Windows Python 2 build - %s extensions: %s" % (len(extensions), os.sep)) |
| 101 | +sys.stdout.write("Windows platform: %s, Python major version: %s.%s" % (ON_WINDOWS, _PYTHON_MAJOR_VERSION, os.linesep)) |
111 | 102 |
|
112 | 103 | setup( |
113 | 104 | name='ssh-python', |
|
117 | 108 | license='LGPLv2.1', |
118 | 109 | author='Panos Kittenis', |
119 | 110 | author_email='22e889d8@opayq.com', |
120 | | - description=('libssh C library bindings for Python.'), |
| 111 | + description="libssh C library bindings for Python.", |
121 | 112 | long_description=open('README.rst').read(), |
122 | 113 | packages=find_packages( |
123 | 114 | '.', exclude=('embedded_server', 'embedded_server.*', |
|
133 | 124 | 'Operating System :: OS Independent', |
134 | 125 | 'Programming Language :: C', |
135 | 126 | 'Programming Language :: Python', |
136 | | - 'Programming Language :: Python :: 2', |
137 | | - 'Programming Language :: Python :: 2.7', |
138 | 127 | 'Programming Language :: Python :: 3', |
139 | 128 | 'Programming Language :: Python :: 3.6', |
140 | 129 | 'Programming Language :: Python :: 3.7', |
141 | 130 | 'Programming Language :: Python :: 3.8', |
| 131 | + 'Programming Language :: Python :: 3.9', |
| 132 | + 'Programming Language :: Python :: 3.10', |
142 | 133 | 'Topic :: System :: Shells', |
143 | 134 | 'Topic :: System :: Networking', |
144 | 135 | 'Topic :: Software Development :: Libraries', |
|
147 | 138 | 'Operating System :: POSIX :: Linux', |
148 | 139 | 'Operating System :: POSIX :: BSD', |
149 | 140 | 'Operating System :: MacOS :: MacOS X', |
| 141 | + 'Operating System :: Microsoft :: Windows', |
150 | 142 | ], |
151 | 143 | ext_modules=extensions, |
152 | 144 | package_data=package_data, |
|
0 commit comments