From 3e936a344f1010bbbd1cf10e25fbd2f4a857a097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Thu, 28 Jun 2018 21:23:52 +0200 Subject: [PATCH 1/3] Force cython when building sdist Fixes #182 --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a1a87a2f..949098c1 100644 --- a/setup.py +++ b/setup.py @@ -77,12 +77,18 @@ sys.modules['distutils.command.build_ext'].Extension = _Extension with_cython = False +if 'sdist' in sys.argv: + # we need cython here + with_cython = True try: from Cython.Distutils.extension import Extension as _Extension from Cython.Distutils import build_ext as _build_ext with_cython = True except ImportError: - pass + if with_cython: + raise + else: + pass try: from wheel.bdist_wheel import bdist_wheel From ccc295ede2918784d6731ef8bdf96fe022880b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tina=20M=C3=BCller?= Date: Thu, 28 Jun 2018 21:31:47 +0200 Subject: [PATCH 2/3] Add a warning if cython could not be loaded, but is not required --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 949098c1..5fdc7613 100644 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ if with_cython: raise else: - pass + log.warn("WARNING: failed to import cython, may not be able compile extensions") try: from wheel.bdist_wheel import bdist_wheel From 05c52d0312baf1d189dc8d4379acf30ccc8d9615 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 28 Jun 2018 12:43:21 -0700 Subject: [PATCH 3/3] Install cython alongside tox --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fcb8f8e7..603ee947 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,6 @@ matrix: - python: pypy env: TOXENV=pypy -install: pip install tox +install: pip install cython tox script: tox