Skip to content

Commit

Permalink
gui - ignore missing pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Dec 29, 2023
1 parent 921f7be commit 5cf9596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions ovl_util/auto_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import logging
import subprocess

# pkg_resources and importlib.metadata are not available on py 3.7, 3.12
from pkg_resources import packaging # type: ignore
try:
# pkg_resources and importlib.metadata are not available on py 3.7, 3.12
from pkg_resources import packaging # type: ignore
except:
logging.warning(f"pkg_resources is not available")
packaging = None
from importlib import import_module
from importlib.metadata import distribution, PackageNotFoundError, packages_distributions

Expand Down Expand Up @@ -57,9 +61,10 @@ def pip_upgrade(package) -> int:
if lib in pkgs:
MODULES.append(module)
# Check version
if packaging.version.parse(lib_dist.metadata['Version']) < packaging.version.parse(version):
logging.warning(f"{lib} is out of date.")
OUTDATED[lib] = line # Need full line including ~= for pip install command
if packaging is not None:
if packaging.version.parse(lib_dist.metadata['Version']) < packaging.version.parse(version):
logging.warning(f"{lib} is out of date.")
OUTDATED[lib] = line # Need full line including ~= for pip install command
except PackageNotFoundError:
logging.error(f"{lib} not found.")
MISSING[lib] = line # Need full line including ~= for pip install command
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4a0767bb0 - Thu Dec 28 12:01:09 2023 +0100
921f7be5f - Fri Dec 29 20:12:17 2023 +0100

0 comments on commit 5cf9596

Please sign in to comment.