Skip to content

Commit

Permalink
clean up setup.py some
Browse files Browse the repository at this point in the history
  • Loading branch information
njsmith committed Mar 25, 2014
1 parent 1835b25 commit 9b5c972
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions .this_is_a_checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Marker file that doesn't exist in sdist builds; see setup.py
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include tox.ini
include DEV-NOTES LICENSE.txt README.rst
include zss/pycrc-crc32c.h zss/pycrc-crc32c.c
recursive-include doc *
Expand Down
27 changes: 21 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
import os.path


if os.path.exists(".this_is_a_checkout"):
USE_CYTHON = True
else:
# Don't depend on Cython in builds-from-sdist
USE_CYTHON = False

DESC = """Compressed sorted sets -- a space-efficient, static database."""

Expand All @@ -10,6 +17,18 @@
"range queries, and decompression. (Original use case:\n"
"working with the multi-terabyte Google n-gram releases.)")

if USE_CYTHON:
cython_ext = "pyx"
else:
cython_ext = "c"
ext_modules = [
Extension("zss._zss", ["zss/_zss.%s" % (cython_ext,)])
]
if USE_CYTHON:
from Cython.Build import cythonize
#import pdb; pdb.set_trace()
ext_modules = cythonize(ext_modules)

setup(
name="zss",
version="0.0.0+dev",
Expand Down Expand Up @@ -47,9 +66,5 @@
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
],
ext_modules=cythonize([
Extension("zss._zss",
["zss/_zss.pyx"],
)
]),
ext_modules=ext_modules,
)

0 comments on commit 9b5c972

Please sign in to comment.