From 8ff0befe00ca76df895c2c60feba109c61b0d220 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Fri, 20 Jul 2018 11:12:03 -0700 Subject: [PATCH] Re-instate conda version check fix Lost https://github.com/jupyterhub/the-littlest-jupyterhub/pull/58 to a rebase. Put it back! --- tljh/conda.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tljh/conda.py b/tljh/conda.py index 02e28cc..96ef324 100644 --- a/tljh/conda.py +++ b/tljh/conda.py @@ -8,6 +8,7 @@ import hashlib import contextlib import tempfile import urllib.request +from distutils.version import LooseVersion as V def md5_file(fname): @@ -28,12 +29,13 @@ def check_miniconda_version(prefix, version): Return true if a miniconda install with version exists at prefix """ try: - return subprocess.check_output([ + installed_version = subprocess.check_output([ os.path.join(prefix, 'bin', 'conda'), '-V' - ]).decode().strip() == 'conda {}'.format(version) + ]).decode().strip().split()[1] + return V(installed_version) >= V(version) except (subprocess.CalledProcessError, FileNotFoundError): - # Conda doesn't exist, or wrong version + # Conda doesn't exist return False