python: use system-site-packages for venv

on Alpine pillow package from pip can't be built
This commit is contained in:
Corentin Le Molgat
2021-12-13 15:27:26 +01:00
parent 9989323661
commit 689160bfe1
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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