Skip to content

Commit

Permalink
Make use of no extensions flag during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Sep 7, 2018
1 parent 7291701 commit 53dce8a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup.py
Expand Up @@ -11,15 +11,18 @@
from distutils.command.build_ext import build_ext


PROFILE_BUILD = bool(os.environ.get('PROFILE_BUILD'))
NO_EXTENSIONS = bool(os.environ.get('MULTIDICT_NO_EXTENSIONS'))
PYPY = platform.python_implementation() == 'PyPy'
USE_CYTHON_EXTENSIONS = not NO_EXTENSIONS and not PYPY
here = pathlib.Path(__file__).parent


# Fallbacks for PyPy: don't use C extensions
extensions = []
cmdclass = {}

if not PYPY:
if USE_CYTHON_EXTENSIONS:
try:
from Cython.Build import cythonize
USE_CYTHON = True
Expand All @@ -35,7 +38,7 @@

ext = '.pyx' if USE_CYTHON else '.c'

if bool(os.environ.get('PROFILE_BUILD')):
if PROFILE_BUILD:
macros = [('CYTHON_TRACE', '1')]
else:
macros = []
Expand All @@ -59,7 +62,7 @@
]

if USE_CYTHON:
if bool(os.environ.get('PROFILE_BUILD')):
if PROFILE_BUILD:
directives = {"linetrace": True}
else:
directives = {}
Expand Down

0 comments on commit 53dce8a

Please sign in to comment.