From fd153678361a4f8b85ddb75774d2481cc8abd03d Mon Sep 17 00:00:00 2001 From: Alejandro Cabrera Date: Fri, 30 Aug 2013 08:29:40 -0400 Subject: [PATCH 1/3] fix(setup): don't warn re: cython under pypy When installing Falcon using pypy, don't bother checking for cython - it's meaningless for pypy. --- setup.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index e34d2f9..ae5ac8e 100644 --- a/setup.py +++ b/setup.py @@ -11,14 +11,21 @@ if sys.version_info < (2, 7): REQUIRES.append('ordereddict') #if 'develop' not in sys.argv - +PYPY = True +with_cython = False try: - from Cython.Distutils import build_ext - with_cython = True -except ImportError: - print('\nWARNING: Cython not installed. ' - 'Falcon modules WILL NOT be compiled with Cython.\n') - with_cython = False + sys.pypy_version_info +except NameError: + PYPY = False + +if not PYPY: + try: + from Cython.Distutils import build_ext + with_cython = True + except ImportError: + print('\nWARNING: Cython not installed. ' + 'Falcon modules WILL NOT be compiled with Cython.\n') + with_cython = False if with_cython: ext_names = ( From 6636d0b0ec43c4552bddc8271c4987479886835e Mon Sep 17 00:00:00 2001 From: Alejandro Cabrera Date: Fri, 30 Aug 2013 08:41:23 -0400 Subject: [PATCH 2/3] fix(setup): NameError -> AttributeError --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ae5ac8e..8f018bc 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ PYPY = True with_cython = False try: sys.pypy_version_info -except NameError: +except AttributeError: PYPY = False if not PYPY: From c0c088c7480959aed9c00882966bdc91cb8f8e17 Mon Sep 17 00:00:00 2001 From: Alejandro Cabrera Date: Fri, 30 Aug 2013 17:32:18 -0400 Subject: [PATCH 3/3] refactor(setup): --cruft, with_cython -> CYTHON --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 8f018bc..1b4c75c 100644 --- a/setup.py +++ b/setup.py @@ -10,9 +10,8 @@ REQUIRES = ['six'] if sys.version_info < (2, 7): REQUIRES.append('ordereddict') -#if 'develop' not in sys.argv PYPY = True -with_cython = False +CYTHON = False try: sys.pypy_version_info except AttributeError: @@ -21,13 +20,13 @@ except AttributeError: if not PYPY: try: from Cython.Distutils import build_ext - with_cython = True + CYTHON = True except ImportError: print('\nWARNING: Cython not installed. ' 'Falcon modules WILL NOT be compiled with Cython.\n') - with_cython = False + CYTHON = False -if with_cython: +if CYTHON: ext_names = ( 'api', 'api_helpers',