mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
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:
parent
c7cd0a0e9a
commit
36b2af9a31
5
.changeset/fifty-books-fly.md
Normal file
5
.changeset/fifty-books-fly.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
feat:Changed gradio version check from print statement to warning
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user