Skip to content

Commit cefbf90

Browse files
pdgendtfabiobaltieri
authored andcommitted
action: OS dependent python packages installation
Don't use 'west packages pip --install' on Windows. If this tries to update packages that are in use by west itself, it results in a permission error. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 9f6c54d commit cefbf90

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,23 @@ runs:
193193
key: pip-${{ runner.os }}-${{ hashFiles(format('{0}/zephyr/scripts/requirements*.txt', inputs.base-path)) }}
194194

195195
- name: Install Python packages
196+
if: runner.os != 'Windows'
196197
working-directory: ${{ inputs.base-path }}
197198
shell: bash
198-
# The direct use of pip3 should be removed after zephyr 4.1 has been phased out, and the west
199+
# The direct use of pip3 should be removed after zephyr 3.7 has been phased out, and the west
199200
# command should only be used instead.
200201
run: |
201202
west packages pip --install --ignore-venv-check || pip3 install -r zephyr/scripts/requirements.txt
202203
204+
- name: Install Python packages (Windows)
205+
if: runner.os == 'Windows'
206+
working-directory: ${{ inputs.base-path }}
207+
shell: powershell
208+
# The direct use of pip3 should be removed after zephyr 3.7 has been phased out, and the west
209+
# command should only be used instead.
210+
run: |
211+
pip3 install @((west packages pip) -split ' '); if (!$?) { pip3 install -r zephyr/scripts/requirements.txt }
212+
203213
- name: Cache Zephyr SDK
204214
id: cache-toolchain
205215
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0

0 commit comments

Comments
 (0)