From 5115707ce9c8a85e1bc4a5258be295162f312d01 Mon Sep 17 00:00:00 2001 From: Ankesh Anand Date: Fri, 21 Dec 2018 15:47:48 -0500 Subject: [PATCH] Recognize nightly tf builds (#763) * Recognize nightly tf builds * Use LooseVersion instead of StrictVersion to recongnize nightly build numbers Nightly version numbers are of the form `1.3.0.dev20181215` but it's not a valid version number for `StrictVersion`, while `LooseVersion` still recognizes it. --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 2e5e36a..130cdb5 100644 --- a/setup.py +++ b/setup.py @@ -53,11 +53,11 @@ setup(name='baselines', # ensure there is some tensorflow build with version above 1.4 import pkg_resources tf_pkg = None -for tf_pkg_name in ['tensorflow', 'tensorflow-gpu']: +for tf_pkg_name in ['tensorflow', 'tensorflow-gpu', 'tf-nightly', 'tf-nightly-gpu']: try: tf_pkg = pkg_resources.get_distribution(tf_pkg_name) except pkg_resources.DistributionNotFound: pass assert tf_pkg is not None, 'TensorFlow needed, of version above 1.4' -from distutils.version import StrictVersion -assert StrictVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= StrictVersion('1.4.0') +from distutils.version import LooseVersion +assert LooseVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= LooseVersion('1.4.0')