python: use system-site-packages for venv
on Alpine pillow package from pip can't be built
This commit is contained in:
@@ -290,7 +290,7 @@ if(BUILD_TESTING)
|
||||
add_custom_command(TARGET python_package POST_BUILD
|
||||
# Clean previous install otherwise pip install may do nothing
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${VENV_DIR}
|
||||
COMMAND ${VENV_EXECUTABLE} -p ${Python3_EXECUTABLE} ${VENV_DIR}
|
||||
COMMAND ${VENV_EXECUTABLE} -p ${Python3_EXECUTABLE} --system-site-packages ${VENV_DIR}
|
||||
#COMMAND ${VENV_EXECUTABLE} ${VENV_DIR}
|
||||
# Must NOT call it in a folder containing the setup.py otherwise pip call it
|
||||
# (i.e. "python setup.py bdist") while we want to consume the wheel package
|
||||
|
||||
@@ -1038,7 +1038,7 @@ endif
|
||||
.PHONY: test_package_python # Test Python "ortools" wheel package
|
||||
test_package_python: package_python
|
||||
-$(DELREC) $(PYPI_ARCHIVE_TEMP_DIR)$Svenv
|
||||
$(PYTHON_EXECUTABLE) -m venv $(PYPI_ARCHIVE_TEMP_DIR)$Svenv
|
||||
$(PYTHON_EXECUTABLE) -m venv --system-site-packages $(PYPI_ARCHIVE_TEMP_DIR)$Svenv
|
||||
$(COPY) test.py.in $(PYPI_ARCHIVE_TEMP_DIR)$Svenv$Stest.py
|
||||
$(COPY) ortools$Salgorithms$Ssamples$Ssimple_knapsack_program.py $(PYPI_ARCHIVE_TEMP_DIR)$Svenv
|
||||
$(COPY) ortools$Sgraph$Ssamples$Ssimple_max_flow_program.py $(PYPI_ARCHIVE_TEMP_DIR)$Svenv
|
||||
|
||||
Reference in New Issue
Block a user