Skip to content

Commit

Permalink
Changed gradio version check from print statement to warning (#8609)
Browse files Browse the repository at this point in the history
* changed print statement to warning

* Updated warnings in single line

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>
  • Loading branch information
gdevakumar and gradio-pr-bot authored Jun 25, 2024
1 parent c7cd0a0 commit 36b2af9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-books-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

feat:Changed gradio version check from print statement to warning
6 changes: 3 additions & 3 deletions gradio/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 36b2af9

Please sign in to comment.