Skip to content

Commit f05f391

Browse files
author
Pan
committed
Update setup.py for from source builds without cython.
Test sdist builds on travis. Include pxd/pyx files on sdist distributables. Resolves #98
1 parent 6b9ee72 commit f05f391

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ script:
2727
- nosetests --with-coverage --cover-package=pssh
2828
- flake8 pssh
2929
- cd doc; make html; cd ..
30+
# Test building from source distribution
31+
- python setup.py sdist
32+
- cd dist; pip install *; cd ..
3033
after_success:
3134
- codecov
3235
jobs:

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
include versioneer.py
22
include pssh/_version.py
33
recursive-exclude tests *
4+
include pssh/native/*.c
5+
include pssh/native/*.pyx

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import versioneer
2121

2222
try:
23-
from Cython.Build import cythonize
2423
from Cython.Distutils.extension import Extension
2524
from Cython.Distutils import build_ext
2625
except ImportError:
@@ -45,10 +44,12 @@
4544
# 'libeay32', 'ssleay32',
4645
'Ws2_32', 'libssh2', 'user32']
4746

47+
48+
ext = 'pyx' if USING_CYTHON else 'c'
4849
_comp_args = ["-O3"] if platform.system() != 'Windows' else None
4950
extensions = [
5051
Extension('pssh.native._ssh2',
51-
sources=['pssh/native/_ssh2.pyx'],
52+
sources=['pssh/native/_ssh2.%s' % ext],
5253
include_dirs=["libssh2/include"],
5354
libraries=_libs,
5455
extra_compile_args=_comp_args,

0 commit comments

Comments
 (0)