Permalink
Browse files

Fix dependency check in setup

Previous version failed when there were characters other than digits or dots.
  • Loading branch information...
1 parent 95f7177 commit fbf51a950897a6139288cfa3fc89bd4ff9552664 @ahojnnes ahojnnes committed Dec 9, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 setup.py
View
@@ -27,6 +27,7 @@
import os
import sys
+import re
import setuptools
from numpy.distutils.core import setup
try:
@@ -72,8 +73,8 @@ def get_package_version(package):
for version_attr in ('version', 'VERSION', '__version__'):
if hasattr(package, version_attr) \
and isinstance(getattr(package, version_attr), str):
- version_info = getattr(package, version_attr)
- for part in version_info.split('.'):
+ version_info = getattr(package, version_attr, '')
+ for part in re.split('\D+', version_info):
try:
version.append(int(part))
except ValueError:

0 comments on commit fbf51a9

Please sign in to comment.