gradio/website/check_version.py
Aarni Koskela ef3862e075
Switch linting to Ruff (#3710)
* Sort requirements.in

* Switch flake8 + isort to ruff

* Apply ruff import order fixes

* Fix ruff complaints in demo/

* Fix ruff complaints in test/

* Use `x is not y`, not `not x is y`

* Remove unused listdir from website generator

* Clean up duplicate dict keys

* Add changelog entry

* Clean up unused imports (except in gradio/__init__.py)

* add space

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-04-03 15:48:18 -07:00

25 lines
579 B
Python

import os
import sys
import time
from homepage.utils import get_latest_stable
VERSION_TXT = os.path.abspath(os.path.join(os.getcwd(), "..", "gradio", "version.txt"))
with open(VERSION_TXT) as f:
version = f.read()
version = version.strip()
def wait_for_version(version: str):
for _ in range(10):
latest_gradio_stable = get_latest_stable()
if version == latest_gradio_stable:
return True
else:
time.sleep(60)
sys.exit(f"Gradio v{version} is a prerelease or does not exist.")
wait_for_version(version)