From ab3a6625fcacb370217aef9a5160c0337a1c3e44 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Thu, 28 Sep 2023 14:56:44 -0400 Subject: [PATCH] Add packaging to list of dependencies Now that packaging is no longer part of the standard library, we need to add it to the list of dependencies. This solves the issue seen when trying to run `broker --help`. --- broker/commands.py | 5 ++--- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/broker/commands.py b/broker/commands.py index 08844dbe..598df858 100644 --- a/broker/commands.py +++ b/broker/commands.py @@ -156,14 +156,13 @@ def provider_cmd(ctx, *args, **kwargs): # the actual subcommand def cli(version): """Command-line interface for interacting with providers.""" if version: + from packaging.version import Version import pkg_resources + import requests broker_version = pkg_resources.get_distribution("broker").version # check the latest version publish to PyPi try: - from packaging.version import Version - import requests - latest_version = Version( requests.get("https://pypi.org/pypi/broker/json", timeout=60).json()["info"][ "version" diff --git a/pyproject.toml b/pyproject.toml index 2fb2ff8e..f0abb396 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "click", "dynaconf<4.0.0", "logzero", + "packaging", "pyyaml", "setuptools", "ssh2-python",