Permalink
Browse files

buildsystem interoperability

  • Loading branch information...
1 parent 71c83d7 commit 6dbdc1cac0a579e3b491ad0b32795bdba91d292e @strohel committed Oct 3, 2011
Showing with 6 additions and 4 deletions.
  1. +1 −1 support/__init__.py
  2. +5 −3 support/dist.py
View
@@ -17,7 +17,7 @@ def determine_pybayes_version(dir, fallback):
os.chdir(dir)
version = str(subprocess.check_output(['git', 'describe', '--dirty'])).lstrip('v').rstrip()
os.chdir(orig_dir)
- except StandardError as e:
+ except Exception as e: # CalledProcessError subclassed Exception directly
print "Failed to determine version using git:", e
version = fallback
return version
View
@@ -60,7 +60,7 @@ def finalize_command_line(self):
requested = strtobool(self.use_cython)
if requested and not self._find_cython():
raise DistutilsOptionError("Cython build was requested but no or too old Cython"
- + " found on your system.")
+ + " and/or NumPy was found on your system.")
self.use_cython = bool(requested)
if self.use_cython:
log.debug("Cython build requested and Cython and NumPy found.")
@@ -88,15 +88,17 @@ def _find_cython(self):
try:
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
- except ImportError:
+ except ImportError as e:
+ log.debug("Cython was not found: {0}".format(e))
return False
self.build_ext = build_ext
self.Extension = Extension
# determine path to NumPy C header files
try:
import numpy
- except ImportError:
+ except ImportError as e:
+ log.warn("Error importing numpy: {0}".format(e))
log.warn("Cython was found on your system, but NumPy was not. NumPy is needed")
log.warn("build-time for cython builds and runtime for all builds. Falling back")
log.warn("to pure Python build.")

0 comments on commit 6dbdc1c

Please sign in to comment.