diff --git a/bloom/commands/release.py b/bloom/commands/release.py index 06c5dbad..35837e00 100644 --- a/bloom/commands/release.py +++ b/bloom/commands/release.py @@ -49,8 +49,6 @@ import webbrowser import yaml -from packaging import version - # python2/3 compatibility try: from urllib.error import HTTPError, URLError diff --git a/bloom/commands/update.py b/bloom/commands/update.py index d300a1a9..692c849c 100644 --- a/bloom/commands/update.py +++ b/bloom/commands/update.py @@ -51,7 +51,7 @@ from bloom.util import add_global_arguments from bloom.util import handle_global_arguments -from packaging import version +from packaging.version import parse as parse_version from threading import Lock _updater_running = False @@ -115,7 +115,7 @@ def fetch_update(user_bloom): newest_version = pypi_result['info']['version'] current_version = bloom.__version__ if newest_version and bloom.__version__ != 'unset': - if version.parse(bloom.__version__) < version.parse(newest_version): + if parse_version(bloom.__version__) < parse_version(newest_version): version_dict = { 'current': str(current_version), 'newest': str(newest_version) diff --git a/bloom/generators/debian/generator.py b/bloom/generators/debian/generator.py index 7bd50ad5..fe629c8d 100644 --- a/bloom/generators/debian/generator.py +++ b/bloom/generators/debian/generator.py @@ -49,7 +49,7 @@ except ImportError: from ConfigParser import SafeConfigParser from dateutil import tz -from packaging import version +from packaging.version import parse as parse_version from bloom.generators import BloomGenerator from bloom.generators import GeneratorError @@ -449,7 +449,7 @@ def generate_substitutions_from_package( bad_changelog = True # Make sure that the current version is the latest in the changelog for changelog in changelogs: - if version.parse(package.version) < version.parse(changelog[0]): + if parse_version(package.version) < parse_version(changelog[0]): error("") error("There is at least one changelog entry, '{0}', which has a " "newer version than the version of package '{1}' being released, '{2}'." diff --git a/bloom/generators/release.py b/bloom/generators/release.py index 1ffa0298..5eeb4a34 100755 --- a/bloom/generators/release.py +++ b/bloom/generators/release.py @@ -53,8 +53,8 @@ try: import catkin_pkg - from packaging import version - if version.parse(catkin_pkg.__version__) < version.parse('0.3.8'): + from packaging.version import parse as parse_version + if parse_version(catkin_pkg.__version__) < parse_version('0.3.8'): warning("This version of bloom requires catkin_pkg version >= '0.3.8'," " the used version of catkin_pkg is '{0}'".format(catkin_pkg.__version__)) from catkin_pkg import metapackage diff --git a/bloom/git.py b/bloom/git.py index 3411b68e..6a0ea58f 100755 --- a/bloom/git.py +++ b/bloom/git.py @@ -44,8 +44,6 @@ from subprocess import PIPE from subprocess import CalledProcessError -from packaging import version - from bloom.logging import debug from bloom.logging import error from bloom.logging import fmt @@ -687,7 +685,7 @@ def get_last_tag_by_version(directory=None): versions = [] for line in output.splitlines(): tags.append(line.strip()) - ver = re.match("[0-9]+.[0-9]+.[0-9]+", line) + ver = re.match(r"[0-9]+\.[0-9]+\.[0-9]+", line) if ver: versions.append(ver) return tags[versions.index(max(versions))] if versions else '' diff --git a/bloom/rosdistro_api.py b/bloom/rosdistro_api.py index eea46189..b951952c 100644 --- a/bloom/rosdistro_api.py +++ b/bloom/rosdistro_api.py @@ -38,7 +38,7 @@ import sys import traceback -from packaging import version +from packaging.version import parse as parse_version # python2/3 compatibility try: @@ -58,7 +58,7 @@ try: import rosdistro - if version.parse(rosdistro.__version__) < version.parse('0.7.0'): + if parse_version(rosdistro.__version__) < parse_version('0.7.0'): error("rosdistro version 0.7.0 or greater is required, found '{0}' from '{1}'." .format(rosdistro.__version__, os.path.dirname(rosdistro.__file__)), exit=True)