mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
ef3862e075
* 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>
18 lines
485 B
Python
18 lines
485 B
Python
import json
|
|
import sys
|
|
import urllib.request
|
|
from pathlib import Path
|
|
|
|
root_directory = Path(__file__).parent.parent
|
|
version = (root_directory / "gradio" / "version.txt").read_text(
|
|
encoding='utf8').strip()
|
|
|
|
with urllib.request.urlopen("https://pypi.org/pypi/gradio/json") as url:
|
|
releases = json.load(url)["releases"]
|
|
|
|
if version in releases:
|
|
print(f"Version {version} already exists on PyPI")
|
|
sys.exit(1)
|
|
else:
|
|
print(f"Version {version} does not exist on PyPI")
|