diff --git a/jenkins_jobs/registry.py b/jenkins_jobs/registry.py index 963fa9332..c16a46084 100644 --- a/jenkins_jobs/registry.py +++ b/jenkins_jobs/registry.py @@ -18,10 +18,10 @@ import inspect import logging import operator +import packaging.version import pkg_resources import sys import types -from pkg_resources.extern.packaging.version import InvalidVersion from six import PY2 @@ -76,8 +76,8 @@ class ModuleRegistry(object): version = plugin_info["version"] try: - pkg_resources.parse_version(version) - except InvalidVersion: + packaging.version.Version(version) + except packaging.version.InvalidVersion: plugin_name = short_name or long_name if plugin_name: logger.warning( diff --git a/requirements.txt b/requirements.txt index ae75ba940..eb2c02ab5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ stevedore>=1.17.1; python_version >= '3.0' # Apache-2.0 python-jenkins>=1.8.2 fasteners Jinja2 -setuptools==69.5.1; python_version >= '3.8' -setuptools; python_version < '3.8' +packaging +setuptools