Skip to content
Snippets Groups Projects
Commit efa95080 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[gitlab.release] Remove use of distutils for python-3.12 compat

parent 23487f37
Branches
No related tags found
No related merge requests found
Pipeline #85433 passed
...@@ -8,8 +8,6 @@ import logging ...@@ -8,8 +8,6 @@ import logging
import re import re
import time import time
from distutils.version import StrictVersion
import gitlab import gitlab
import gitlab.v4.objects import gitlab.v4.objects
import packaging.requirements import packaging.requirements
...@@ -423,12 +421,12 @@ def get_latest_tag_name( ...@@ -423,12 +421,12 @@ def get_latest_tag_name(
tag_names = [ tag_names = [
tag.name[1:] tag.name[1:]
for tag in latest_tags for tag in latest_tags
if StrictVersion.version_re.match(tag.name[1:]) if re.match(packaging.version.VERSION_PATTERN, tag.name[1:])
] ]
if not tag_names: # no tags were found. if not tag_names: # no tags were found.
return None return None
# sort them correctly according to each subversion number # sort them correctly according to each version number
tag_names.sort(key=StrictVersion) tag_names.sort(key=packaging.version.Version)
# take the last one, as it is the latest tag in the sorted tags # take the last one, as it is the latest tag in the sorted tags
return tag_names[-1] return tag_names[-1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment