From b2d02ed624f9354214228c3f4d5dcb1a74d792b3 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 11 Dec 2023 02:50:33 +0100 Subject: Change default port for gui Change default host for api Disable gui in build Add custom docker user --- g4f/debug.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'g4f/debug.py') diff --git a/g4f/debug.py b/g4f/debug.py index 85009277..1ee1506f 100644 --- a/g4f/debug.py +++ b/g4f/debug.py @@ -1,6 +1,6 @@ from os import environ from requests import get -from importlib.metadata import version, PackageNotFoundError +from importlib.metadata import version as get_package_version, PackageNotFoundError from subprocess import check_output, CalledProcessError, PIPE from .errors import VersionNotFoundError @@ -10,7 +10,7 @@ version_check = True def get_version() -> str: # Read from package manager try: - return version("g4f") + return get_package_version("g4f") except PackageNotFoundError: pass # Read from docker environment @@ -33,7 +33,7 @@ def check_pypi_version() -> None: try: version = get_version() latest_version = get_lastet_version() + if version != latest_version: + print(f'New pypi version: {latest_version} (current: {version}) | pip install -U g4f') except Exception as e: - print(f'Failed to check g4f pypi version: {e}') - if version != latest_version: - print(f'New pypi version: {latest_version} (current: {version}) | pip install -U g4f') \ No newline at end of file + print(f'Failed to check g4f pypi version: {e}') \ No newline at end of file -- cgit v1.2.3