Skip to content

Commit

Permalink
Move to the new semver API (#202)
Browse files Browse the repository at this point in the history
* Move to the new semver API

* [squash] compare with object

---------

Co-authored-by: Jean-Michel Picod <jmichel@google.com>
  • Loading branch information
kralka and jmichelp authored Feb 1, 2024
1 parent c6a4a0f commit f6a1f74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scaaml/io/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']}")
Expand Down

0 comments on commit f6a1f74

Please sign in to comment.