update PR deploy
Browse files1383 unmodified lines1384138513861387138813891390139113921393139413951396139713981399140014011402139313941403140414051406140714081383 unmodified lines else: files["app.py"] = cleaned_code # For Gradio PRs, only include .py files (preserve existing requirements.txt, etc.) if language == "gradio": print(f"[PR] Gradio app - filtering to only .py files") py_files = {fname: content for fname, content in files.items() if fname.endswith('.py')} if not py_files: print(f"[PR] Warning: No .py files found in parsed output") return False, "No Python files found in generated code for Gradio PR", None files = py_files print(f"[PR] Will update {len(files)} Python file(s): {list(files.keys())}") # Write files (create subdirectories if needed) for filename, content in files.items(): file_path = temp_path / filename file_path.parent.mkdir(parents=True, exist_ok=True) file_path.write_text(content, encoding='utf-8') # Generate requirements.txt if missing for Python apps if language in ["gradio", "streamlit"] and "requirements.txt" not in files: # Skip requirements.txt generation for Gradio PRs (preserve existing) # For Streamlit, generate requirements.txt if missing if language == "streamlit" and "requirements.txt" not in files: main_app = files.get('streamlit_app.py') or files.get('app.py', '') if main_app: print(f"[PR] Generating requirements.txt from imports")backend_deploy.py+13-2