summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.rst5
-rw-r--r--lower-constraints.txt1
-rw-r--r--oslo_utils/versionutils.py13
-rw-r--r--requirements.txt1
4 files changed, 12 insertions, 8 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 5a598c3..f747a6d 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -1,3 +1,8 @@
+If you would like to contribute to the development of oslo's libraries,
+first you must take a look to this page:
+
+ https://specs.openstack.org/openstack/oslo-specs/specs/policy/contributing.html
+
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 3555586..b1f66ad 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -19,6 +19,7 @@ os-client-config==1.28.0
oslo.config==5.2.0
oslo.i18n==3.15.3
oslotest==3.2.0
+packaging==20.4
pbr==2.0.0
pyparsing==2.1.0
python-mimeparse==1.6.0
diff --git a/oslo_utils/versionutils.py b/oslo_utils/versionutils.py
index 311965d..db8ed0c 100644
--- a/oslo_utils/versionutils.py
+++ b/oslo_utils/versionutils.py
@@ -19,7 +19,7 @@ Helpers for comparing version strings.
.. versionadded:: 1.6
"""
-import pkg_resources
+import packaging.version
import six
from oslo_utils._i18n import _
@@ -39,17 +39,14 @@ def is_compatible(requested_version, current_version, same_major=True):
True.
:returns: True if compatible, False if not
"""
- requested_parts = pkg_resources.parse_version(requested_version)
- current_parts = pkg_resources.parse_version(current_version)
+ requested = packaging.version.Version(requested_version)
+ current = packaging.version.Version(current_version)
if same_major:
- # NOTE(jlvillal) pkg_resources issues a warning if we try to access
- # portions of the version, for example requested_parts[0] will issue a
- # warning message. So get the major_version from the string instead.
- if requested_version.split('.')[0] != current_version.split('.')[0]:
+ if requested.major != current.major:
return False
- return current_parts >= requested_parts
+ return current >= requested
def convert_version_to_int(version):
diff --git a/requirements.txt b/requirements.txt
index 30aa6a8..22d2b78 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,3 +16,4 @@ netaddr>=0.7.18 # BSD
netifaces>=0.10.4 # MIT
debtcollector>=1.2.0 # Apache-2.0
pyparsing>=2.1.0 # MIT
+packaging>=20.4 # BSD