Skip to content

Commit 84e758c

Browse files
committed
Give Python virtual environment access to system site-packages directory
Use the` venv --system-site-packages` flag when creating the Python virtual environment the action's script runs in to allow users to install Python package dependencies of their sketch's boards platform dependencies. The immediate need for this is that the ESP32 boards platform has a dependency on the `pyserial` Python package. The alternative would be to always install this specific package in the setup script, but allowing the user to install arbitrary Python package dependencies makes the action more flexible. The cons: - Increased complexity of workflows compiling for ESP32 platform boards. - Risk of the runner's default packages interfering with the script.
1 parent f31b227 commit 84e758c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

action-setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sudo apt-get install --yes python3-setuptools > /dev/null
2929
sudo apt-get install --yes python${PYTHON_PACKAGE_VERSION}-venv > /dev/null
3030

3131
# Create Python virtual environment
32-
"$PYTHON_COMMAND" -m venv "$PYTHON_VENV_PATH"
32+
"$PYTHON_COMMAND" -m venv --system-site-packages "$PYTHON_VENV_PATH"
3333

3434
# Activate Python virtual environment
3535
# shellcheck source=/dev/null

0 commit comments

Comments
 (0)