mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
3464673064
* Create test.yml * Update deploy-pypi.yml * Update deploy-pypi.yml * Delete test.yml * fixes * fixes * check pypi * check pypi * version * version
18 lines
486 B
Python
18 lines
486 B
Python
import urllib.request
|
|
import json
|
|
import sys
|
|
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")
|