From 19a34a07a4e3efb7416ae6fc52d869942b7ab10c Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Thu, 29 Aug 2019 14:50:48 -0400 Subject: [PATCH] Always use pyximport, since we now require cython. This is optional and helps with development. If we ever need/want to support systems without Cython, this can be wrapped in a try/except:pass block (and the .c files can be included in the MANIFEST.in so that source distributions include them). --- README.txt | 1 + nilmdb/server/__init__.py | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.txt b/README.txt index 932fa0f..7111e10 100644 --- a/README.txt +++ b/README.txt @@ -15,6 +15,7 @@ Prerequisites: pip3 install -r requirements.txt Test: + python3 setup.py nosetests Install: diff --git a/nilmdb/server/__init__.py b/nilmdb/server/__init__.py index 89c60a8..9073984 100644 --- a/nilmdb/server/__init__.py +++ b/nilmdb/server/__init__.py @@ -1,13 +1,8 @@ """nilmdb.server""" -# Try to set up pyximport to automatically rebuild Cython modules. If -# this doesn't work, it's OK, as long as the modules were built externally. -# (e.g. python setup.py build_ext --inplace) -try: # pragma: no cover - import pyximport - pyximport.install(inplace = True, build_in_temp = False) -except (ImportError, TypeError): # pragma: no cover - pass +# Set up pyximport to automatically rebuild Cython modules if needed. +import pyximport +pyximport.install(inplace = True, build_in_temp = False) from nilmdb.server.nilmdb import NilmDB from nilmdb.server.server import Server, wsgi_application