diff --git a/murano/dsl/helpers.py b/murano/dsl/helpers.py index 57757a8a..fd0479eb 100644 --- a/murano/dsl/helpers.py +++ b/murano/dsl/helpers.py @@ -275,6 +275,12 @@ def parse_version_spec(version_spec): if not version_spec: version_spec = '0' version_spec = re.sub('\s+', '', str(version_spec)) + + # NOTE(kzaitsev): semantic_version 2.3.X thinks that '=0' is not + # a valid version spec and only accepts '==0', this regexp adds + # an extra '=' before such specs + version_spec = re.sub(r'^=(\d)', r'==\1', version_spec) + if version_spec[0].isdigit(): version_spec = '==' + str(version_spec) version_spec = semantic_version.Spec(version_spec) diff --git a/releasenotes/notes/spec-semver-library-436b0db35fbd4c37.yaml b/releasenotes/notes/spec-semver-library-436b0db35fbd4c37.yaml new file mode 100644 index 00000000..fd823ae6 --- /dev/null +++ b/releasenotes/notes/spec-semver-library-436b0db35fbd4c37.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - It is now possible to use version specifications like '=0.0.0' when + ``semantic_version`` library version '2.3.1' is installed. Previously + such specifications caused an error and '==0.0.0' had to be used.