Add a check for minimum augur version
Avoid issues caused by outdated augur installations by explicitly checking for a
specified minimum augur version. If the appropriate augur version is installed,
the appropriate TreeTime should also have been installed via setup.py, so this
commit does not introduce a minimum TreeTime version.
Closes
from os import environ
+from packaging import version
from socket import getfqdn
from getpass import getuser
+from snakemake.logging import logger
+import sys
+
+#
+# Verify that required versions of dependencies are installed.
+#
+MIN_AUGUR_VERSION = "7.0.2"
+
+try:
+ from augur.__version__ import __version__ as augur_version
+except ModuleNotFoundError:
+ logger.error("ERROR: Could not find augur. Follow installation instructions at https://nextstrain.org/docs/ and try again.")
+ sys.exit(1)
+
+if version.parse(augur_version) < version.parse(MIN_AUGUR_VERSION):
+ logger.error("ERROR: Found version '%s' of augur, but version '%s' or greater is required" % (augur_version, MIN_AUGUR_VERSION))
+ sys.exit(1)
def get_todays_date():
from datetime import datetime
