From 00caa0a04306bb48d423bbd639d97715a2241863 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Tue, 20 Feb 2018 16:39:24 +0100 Subject: [PATCH 1/2] [setup] Quick fix local install dependency issue --- setup.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cceb368d..a5e1ff11 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,25 @@ from setuptools import setup except ImportError as ex: from distutils.core import setup -from odml.info import AUTHOR, CONTACT, CLASSIFIERS, HOMEPAGE, VERSION + +try: + from odml.info import AUTHOR, CONTACT, CLASSIFIERS, HOMEPAGE, VERSION +except ImportError as ex: + # Read the information from odml.info.py if package dependencies + # are not yet available during a local install. + CLASSIFIERS = "" + with open('odml/info.py') as f: + for line in f: + curr_args = line.split(" = ") + if len(curr_args) == 2: + if curr_args[0] == "AUTHOR": + AUTHOR = curr_args[1].replace('\'', '').replace('\\', '').strip() + elif curr_args[0] == "CONTACT": + CONTACT = curr_args[1].replace('\'', '').strip() + elif curr_args[0] == "HOMEPAGE": + HOMEPAGE = curr_args[1].replace('\'', '').strip() + elif curr_args[0] == "VERSION": + VERSION = curr_args[1].replace('\'', '').strip() packages = [ 'odml', From e200571a21989eb9b3bad18381163a187be8240a Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 21 Feb 2018 15:56:56 +0100 Subject: [PATCH 2/2] [dtypes] Py2 boolean get fix Closes #222 --- odml/dtypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odml/dtypes.py b/odml/dtypes.py index 9f028e67..36af0205 100644 --- a/odml/dtypes.py +++ b/odml/dtypes.py @@ -196,7 +196,7 @@ def datetime_set(value): def boolean_get(string): if string is None: return None - if isinstance(string, unicode): + if type(string) in (unicode, str): string = string.lower() truth = ["true", "1", True, "t"] # be kind, spec only accepts True / False if string in truth: