Skip to content

Commit e38e05f

Browse files
authored
build: add PyPI fallback to Python setup (#16228)
1 parent 05a216b commit e38e05f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

cmake/python_setup.cmake

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,28 @@ function(FirebaseSetupPythonInterpreter)
152152
"${LOG_PREFIX}: Installing Python dependencies into "
153153
"${PYVENV_DIRECTORY}: ${ARG_REQUIREMENTS}"
154154
)
155-
firebase_execute_process(
155+
execute_process(
156156
COMMAND
157157
"${PYTHON_EXECUTABLE}"
158158
-m
159159
pip
160160
install
161161
${ARG_REQUIREMENTS}
162+
RESULT_VARIABLE PIP_INSTALL_STATUS
162163
)
164+
if(NOT PIP_INSTALL_STATUS EQUAL 0)
165+
message(STATUS "${LOG_PREFIX}: pip install failed. Retrying with public PyPI index...")
166+
firebase_execute_process(
167+
COMMAND
168+
"${PYTHON_EXECUTABLE}"
169+
-m
170+
pip
171+
install
172+
--index-url
173+
https://pypi.org/simple
174+
${ARG_REQUIREMENTS}
175+
)
176+
endif()
163177
endif()
164178

165179
# Write the stamp files.

0 commit comments

Comments
 (0)