From e38e05ff4adf1b0294deacd95e24a2c63c3ab7be Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Wed, 10 Jun 2026 09:40:54 -0500 Subject: [PATCH] build: add PyPI fallback to Python setup (#16228) --- cmake/python_setup.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/python_setup.cmake b/cmake/python_setup.cmake index 5a1697af8e..ebc5f662ee 100644 --- a/cmake/python_setup.cmake +++ b/cmake/python_setup.cmake @@ -152,14 +152,28 @@ function(FirebaseSetupPythonInterpreter) "${LOG_PREFIX}: Installing Python dependencies into " "${PYVENV_DIRECTORY}: ${ARG_REQUIREMENTS}" ) - firebase_execute_process( + execute_process( COMMAND "${PYTHON_EXECUTABLE}" -m pip install ${ARG_REQUIREMENTS} + RESULT_VARIABLE PIP_INSTALL_STATUS ) + if(NOT PIP_INSTALL_STATUS EQUAL 0) + message(STATUS "${LOG_PREFIX}: pip install failed. Retrying with public PyPI index...") + firebase_execute_process( + COMMAND + "${PYTHON_EXECUTABLE}" + -m + pip + install + --index-url + https://pypi.org/simple + ${ARG_REQUIREMENTS} + ) + endif() endif() # Write the stamp files.