Spaces:
Paused
Paused
Download test_quick.sh from Sidd6555/Voucher-Generator: direct link, hf CLI and curl.
- Browser
- Download file 2.13 kB
-
https://huggingface.co/spaces/Sidd6555/Voucher-Generator/resolve/main/test_quick.sh
- Command line
-
hf download hf://spaces/Sidd6555/Voucher-Generator/test_quick.sh
-
curl -L -o test_quick.sh https://huggingface.co/spaces/Sidd6555/Voucher-Generator/resolve/main/test_quick.sh
2.13 kB
| # Quick deployment test - run this before pushing to HuggingFace | |
| echo "π Quick Deployment Test" | |
| echo "========================" | |
| # Test 1: Python syntax check | |
| echo "" | |
| echo "1οΈβ£ Checking Python syntax..." | |
| python -m py_compile app.py gemini_utils.py voucher_generator.py | |
| if [ $? -eq 0 ]; then | |
| echo " β No syntax errors" | |
| else | |
| echo " β Syntax errors found!" | |
| exit 1 | |
| fi | |
| # Test 2: Check imports (without running app) | |
| echo "" | |
| echo "2οΈβ£ Testing imports..." | |
| python -c " | |
| import sys | |
| try: | |
| import gradio | |
| import google.genai | |
| import reportlab | |
| import pypdf | |
| import pandas | |
| from PIL import Image | |
| from dotenv import load_dotenv | |
| print(' β All imports successful') | |
| except ImportError as e: | |
| print(f' β Import failed: {e}') | |
| sys.exit(1) | |
| " | |
| if [ $? -ne 0 ]; then | |
| exit 1 | |
| fi | |
| # Test 3: Version compatibility | |
| echo "" | |
| echo "3οΈβ£ Checking Gradio version..." | |
| python -c " | |
| import gradio as gr | |
| print(f' βΉοΈ Gradio version: {gr.__version__}') | |
| try: | |
| # Test if File component works with PDF support | |
| test = gr.File(label='test', file_types=['.pdf']) | |
| print(' β Gradio File component supports PDFs') | |
| except Exception as e: | |
| print(f' β Error: {e}') | |
| exit(1) | |
| " | |
| # Test 4: README metadata | |
| echo "" | |
| echo "4οΈβ£ Checking README.md metadata..." | |
| if grep -q "sdk: gradio" README.md && grep -q "app_file: app.py" README.md; then | |
| echo " β README.md has valid metadata" | |
| else | |
| echo " β README.md missing required metadata" | |
| exit 1 | |
| fi | |
| # Test 5: Required files | |
| echo "" | |
| echo "5οΈβ£ Checking required files..." | |
| required_files=("app.py" "gemini_utils.py" "voucher_generator.py" "requirements.txt" "README.md") | |
| missing=0 | |
| for file in "${required_files[@]}"; do | |
| if [ -f "$file" ]; then | |
| echo " β $file exists" | |
| else | |
| echo " β $file missing" | |
| missing=1 | |
| fi | |
| done | |
| if [ $missing -eq 1 ]; then | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "========================" | |
| echo "π All tests passed! Ready to deploy." | |
| echo "" | |
| echo "To deploy, run:" | |
| echo " git add ." | |
| echo " git commit -m 'Deploy update'" | |
| echo " git push" | |