Merge "Convert =0 version specs to ==0 specs"

This commit is contained in:
Jenkins 2016-09-22 05:54:43 +00:00 committed by Gerrit Code Review
commit a54072af73
2 changed files with 11 additions and 0 deletions

View File

@ -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)

View File

@ -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.