diff --git a/.travis.yml b/.travis.yml index fc1fe9cf..cb38589a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,9 @@ script: - nosetests --with-coverage --cover-package=pssh - flake8 pssh - cd doc; make html; cd .. + # Test building from source distribution + - python setup.py sdist + - cd dist; pip install *; cd .. after_success: - codecov jobs: diff --git a/MANIFEST.in b/MANIFEST.in index 3b7e8386..4abec022 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include versioneer.py include pssh/_version.py recursive-exclude tests * +include pssh/native/*.c +include pssh/native/*.pyx diff --git a/setup.py b/setup.py index 11c8ea86..8193d1d5 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ import versioneer try: - from Cython.Build import cythonize from Cython.Distutils.extension import Extension from Cython.Distutils import build_ext except ImportError: @@ -45,10 +44,12 @@ # 'libeay32', 'ssleay32', 'Ws2_32', 'libssh2', 'user32'] + +ext = 'pyx' if USING_CYTHON else 'c' _comp_args = ["-O3"] if platform.system() != 'Windows' else None extensions = [ Extension('pssh.native._ssh2', - sources=['pssh/native/_ssh2.pyx'], + sources=['pssh/native/_ssh2.%s' % ext], include_dirs=["libssh2/include"], libraries=_libs, extra_compile_args=_comp_args,