Skip to content

Commit

Permalink
avoid building the C extension under PyPy / Py3k
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 5, 2013
1 parent fe2a5d1 commit 69dbdd3
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,31 @@
#
##############################################################################

import os
from os.path import join
import platform
import sys

from setuptools import setup, find_packages, Extension

README = open('README.rst').read()
CHANGES = open('CHANGES.rst').read()

ext_modules = [
Extension(
name='Missing._Missing',
include_dirs=['include', 'src'],
sources=[join('src', 'Missing', '_Missing.c')],
depends=[join('include', 'ExtensionClass', 'ExtensionClass.h')]),
]
# PyPy won't build the extension
py_impl = getattr(platform, 'python_implementation', lambda: None)
is_pypy = py_impl() == 'PyPy'
is_pure = 'PURE_PYTHON' in os.environ
py3k = sys.version_info >= (3, )
if is_pypy or is_pure or py3k:
ext_modules = []
else:
ext_modules = [
Extension(
name='Missing._Missing',
include_dirs=['include', 'src'],
sources=[join('src', 'Missing', '_Missing.c')],
depends=[join('include', 'ExtensionClass', 'ExtensionClass.h')]),
]


setup(
Expand Down

0 comments on commit 69dbdd3

Please sign in to comment.