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.
This commit is contained in:
6
setup.py
6
setup.py
@@ -53,11 +53,11 @@ setup(name='baselines',
|
|||||||
# ensure there is some tensorflow build with version above 1.4
|
# ensure there is some tensorflow build with version above 1.4
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
tf_pkg = None
|
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:
|
try:
|
||||||
tf_pkg = pkg_resources.get_distribution(tf_pkg_name)
|
tf_pkg = pkg_resources.get_distribution(tf_pkg_name)
|
||||||
except pkg_resources.DistributionNotFound:
|
except pkg_resources.DistributionNotFound:
|
||||||
pass
|
pass
|
||||||
assert tf_pkg is not None, 'TensorFlow needed, of version above 1.4'
|
assert tf_pkg is not None, 'TensorFlow needed, of version above 1.4'
|
||||||
from distutils.version import StrictVersion
|
from distutils.version import LooseVersion
|
||||||
assert StrictVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= StrictVersion('1.4.0')
|
assert LooseVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= LooseVersion('1.4.0')
|
||||||
|
Reference in New Issue
Block a user