Changed gradio version check from print statement to warning (#8609)

* changed print statement to warning

* Updated warnings in single line

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Deva Kumar Gajulamandyam 2024-06-25 07:31:08 -07:00 committed by GitHub
parent c7cd0a0e9a
commit 36b2af9a31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
feat:Changed gradio version check from print statement to warning

View File

@ -103,11 +103,11 @@ def version_check():
current_pkg_version = get_package_version()
latest_pkg_version = httpx.get(url=PKG_VERSION_URL, timeout=3).json()["version"]
if Version(latest_pkg_version) > Version(current_pkg_version):
print(
warnings.warn(
f"IMPORTANT: You are using gradio version {current_pkg_version}, "
f"however version {latest_pkg_version} is available, please upgrade."
f"however version {latest_pkg_version} is available, please upgrade. \n"
f"--------"
)
print("--------")
except json.decoder.JSONDecodeError:
warnings.warn("unable to parse version details from package URL.")
except KeyError: