From f6a1f746dd15c3145db512fe75a7903b4c883433 Mon Sep 17 00:00:00 2001 From: kralka Date: Thu, 1 Feb 2024 15:01:53 +0100 Subject: [PATCH] Move to the new semver API (#202) * Move to the new semver API * [squash] compare with object --------- Co-authored-by: Jean-Michel Picod --- scaaml/io/dataset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scaaml/io/dataset.py b/scaaml/io/dataset.py index 0df4218e..410897ce 100644 --- a/scaaml/io/dataset.py +++ b/scaaml/io/dataset.py @@ -1099,7 +1099,8 @@ def from_config(dataset_path: str, verbose: bool = True): # Check that the library version (version of this software) is not # lower than what was used to capture the dataset. if "scaaml_version" in config.keys(): - if semver.compare(config["scaaml_version"], scaaml.__version__) > 0: + if semver.Version.parse(config["scaaml_version"]).compare( + scaaml.__version__) > 0: raise ValueError(f"SCAAML module is outdated, scaaml_version: " f"{scaaml.__version__}, but dataset was " f"created using: {config['scaaml_version']}")