Skip to content

Commit e5ce163

Browse files
author
Pan
committed
Updated setup.py for readthedocs integration.
1 parent b2fe0d7 commit e5ce163

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dependencies:
55
- setuptools
66
- libssh2
77
- toolchain3
8+
- cython

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
USING_CYTHON = True
2222

2323
ON_WINDOWS = platform.system() == 'Windows'
24+
ON_RTD = os.environ.get('READTHEDOCS') == 'True'
25+
26+
if ON_RTD:
27+
files = glob('ssh2/*.c')
28+
for _file in files:
29+
os.remove(_file)
30+
2431

2532
ext = 'pyx' if USING_CYTHON else 'c'
2633
sources = glob('ssh2/*.%s' % (ext,))
@@ -31,9 +38,10 @@
3138
]
3239

3340
# _comp_args = ["-ggdb"]
41+
_fwd_default = 0 if ON_RTD else 1
3442
_comp_args = ["-O3"] if not ON_WINDOWS else None
3543
_embedded_lib = bool(int(os.environ.get('EMBEDDED_LIB', 1)))
36-
_have_agent_fwd = bool(int(os.environ.get('HAVE_AGENT_FWD', 1)))
44+
_have_agent_fwd = bool(int(os.environ.get('HAVE_AGENT_FWD', _fwd_default)))
3745
cython_directives = {'embedsignature': True,
3846
'boundscheck': False,
3947
'optimize.use_switch': True,

0 commit comments

Comments
 (0)