Skip to content

Commit

Permalink
Run python in isolate mode (microsoft#35990)
Browse files Browse the repository at this point in the history
* Run python in isolate mode.

* v db
  • Loading branch information
Neumann-A authored Jan 11, 2024
1 parent 83444c5 commit 02286a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ports/vcpkg-get-python-packages/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vcpkg-get-python-packages",
"version-date": "2023-07-28",
"version-date": "2024-01-02",
"documentation": "https://vcpkg.io/en/docs/README.html",
"license": "MIT",
"supports": "native"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function(x_vcpkg_get_python_packages)

set(ENV{PYTHONNOUSERSITE} "1")
message(STATUS "Setting up python virtual environmnent...")
vcpkg_execute_required_process(COMMAND "${arg_PYTHON_EXECUTABLE}" -m "${python_venv}" ${python_venv_options} "${venv_path}"
vcpkg_execute_required_process(COMMAND "${arg_PYTHON_EXECUTABLE}" -I -m "${python_venv}" ${python_venv_options} "${venv_path}"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "venv-setup-${TARGET_TRIPLET}")
vcpkg_add_to_path(PREPEND "${venv_path}${python_sub_path}")
Expand All @@ -101,13 +101,13 @@ function(x_vcpkg_get_python_packages)
unset(ENV{PYTHONPATH})
if(DEFINED arg_REQUIREMENTS_FILE)
message(STATUS "Installing requirements from: ${arg_REQUIREMENTS_FILE}")
vcpkg_execute_required_process(COMMAND "${${arg_OUT_PYTHON_VAR}}" -m pip install -r ${arg_REQUIREMENTS_FILE}
vcpkg_execute_required_process(COMMAND "${${arg_OUT_PYTHON_VAR}}" -I -m pip install -r ${arg_REQUIREMENTS_FILE}
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "pip-install-requirements-file-${TARGET_TRIPLET}")
endif()
if(DEFINED arg_PACKAGES)
message(STATUS "Installing python packages: ${arg_PACKAGES}")
vcpkg_execute_required_process(COMMAND "${${arg_OUT_PYTHON_VAR}}" -m pip install ${arg_PACKAGES}
vcpkg_execute_required_process(COMMAND "${${arg_OUT_PYTHON_VAR}}" -I -m pip install ${arg_PACKAGES}
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "pip-install-packages-${TARGET_TRIPLET}")
endif()
Expand Down
6 changes: 5 additions & 1 deletion scripts/cmake/vcpkg_find_acquire_program.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ function(z_vcpkg_find_acquire_program_find_internal program)
PATHS ${arg_PATHS}
NO_DEFAULT_PATH)
if(SCRIPT_${program})
set("${program}" ${${arg_INTERPRETER}} ${SCRIPT_${program}} CACHE INTERNAL "")
if(arg_INTERPRETER MATCHES "PYTHON")
set("${program}" ${${arg_INTERPRETER}} -I ${SCRIPT_${program}} CACHE INTERNAL "")
else()
set("${program}" ${${arg_INTERPRETER}} ${SCRIPT_${program}} CACHE INTERNAL "")
endif()
endif()
unset(SCRIPT_${program} CACHE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8857,7 +8857,7 @@
"port-version": 0
},
"vcpkg-get-python-packages": {
"baseline": "2023-07-28",
"baseline": "2024-01-02",
"port-version": 0
},
"vcpkg-gfortran": {
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-get-python-packages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b6f23effcf3057ccc837f864b9207b651209e608",
"version-date": "2024-01-02",
"port-version": 0
},
{
"git-tree": "80e0cf9d38d72126b34eb1ee9b33f936c778a696",
"version-date": "2023-07-28",
Expand Down

0 comments on commit 02286a8

Please sign in to comment.