gradio/website/check_version.py
Ali Abdalla a80084f3df
Dropdown for seeing docs as latest or main (#2544)
* support docs for pip and git

* upload spaces with gradio wheel

* aws

* upload wheel to aws

* fix error in docker compose

* fix dockerfile

* fix dockerfile

* fix upload demos

* fix upload demos

* styling

* fake change

* remove check_version

* fixes

* fix buttons

* fix navigation on main

* add github action

* build version docs in docker

* fix path and docker errors

* add requests

* fix command

* more docker fixes

* more docker fixes

* no prerelease

* fix restart demos

* undo fake changes, and fix build_version

* fix variable

* fix mistake

* add how to build from main

* new line to requirements

* fix instructions

* Update CHANGELOG.md

* duplicate line in Dockerfile

* switch to github actions, use separate pages

* fix issues in github action

* fix path for github action

* more fixes

* more fixes

* fix github action

* add template

* fix demos template

* update release notes for 3.9

* add -A

* refactor

* keep old version htmls

* unpin gradio version in requirements

* Update website/homepage/src/docs/template.html

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-11-08 13:02:05 +01:00

26 lines
610 B
Python

import time
import requests
import warnings
import os
import sys
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)