Download client/python/scripts/check_pypi.py from mindmime/gradio: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/spaces/mindmime/gradio/resolve/main/client/python/scripts/check_pypi.py
- Command line
-
hf download hf://spaces/mindmime/gradio/client/python/scripts/check_pypi.py
-
curl -L -o check_pypi.py https://huggingface.co/spaces/mindmime/gradio/resolve/main/client/python/scripts/check_pypi.py
499 Bytes
| import json | |
| import sys | |
| import urllib.request | |
| from pathlib import Path | |
| version_file = Path(__file__).parent.parent / "gradio_client" / "package.json" | |
| with version_file.open() as f: | |
| version = json.load(f)["version"] | |
| with urllib.request.urlopen("https://pypi.org/pypi/gradio_client/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") | |