Skip to content

Zephyr fixups - #272

Merged
will-v-pi merged 7 commits into
mainfrom
zephyr-fixups
Oct 6, 2026
Merged

will-v-pi merged 7 commits into
mainfrom
zephyr-fixups

Conversation

@will-v-pi

Copy link
Copy Markdown
Collaborator

Use Python 3.12 with Zephyr, as later versions aren't supported - fixes #267

Fix link to docs - fixes #268

Add instructions to allow script execution for virtual environment - fixes #269

Fix argument passing to west build - fixes #270

Use Python 3.12 with Zephyr, as later versions aren't supported - fixes #267

Fix link to docs - fixes #268

Add instructions to allow script execution for virtual environment - fixes #269

Fix argument passing to west build - fixes #270

Use current folder for Zephyr working directory, and pass -T for the zephyr workspace - fixes #271
west zephyr-export imports build_helpers, which has imported jsonschema since
zephyrproject-rtos/zephyr@0f07a53, so on a fresh workspace the export died with
ModuleNotFoundError - `west packages pip --install` had not run yet.

Running it first matches the order in Zephyr's getting-started, and is safe:
west packages only needs west and yaml, both already in the venv.
@kvnloo

kvnloo commented Sep 29, 2026

Copy link
Copy Markdown

A couple of things seem worth tightening before merge.

First, could we avoid recommending both:

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

and:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

from an Administrator PowerShell?

LocalMachine is machine-wide and broader than the virtual-environment activation requirement. #269 explicitly raised least privilege as a concern.

If PowerShell activation is genuinely necessary, CurrentUser should normally be preferable. Better still, if the extension can invoke venv\Scripts\python.exe / west.exe directly, it shouldn't need to change PowerShell execution policy at all.

Second, showZephyrPythonNotFoundError() currently says:

Zephyr requires exactly Python 3.12 — other versions are not supported.

but the Linux fallback says Python 3.12 is strongly recommended and other versions may work. Could this be described as an extension compatibility pin instead?

Something like:

This extension uses Python 3.12 for the Zephyr environment because required packages may not be available on newer Python releases.

That seems more precise and avoids making a broader claim about every Zephyr configuration.

Comment thread README.md Resolved
Zephyr docs only require the CurrentUser scope
@will-v-pi

Copy link
Copy Markdown
Collaborator Author

A couple of things seem worth tightening before merge.

First, could we avoid recommending both:

Set-ExecutionPolicy RemoteSigned -Scope LocalMachine

and:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

from an Administrator PowerShell?

LocalMachine is machine-wide and broader than the virtual-environment activation requirement. #269 explicitly raised least privilege as a concern.

If PowerShell activation is genuinely necessary, CurrentUser should normally be preferable. Better still, if the extension can invoke venv\Scripts\python.exe / west.exe directly, it shouldn't need to change PowerShell execution policy at all.

I've removed LocalMachine, as the Zephyr docs only require CurrentUser - I won't remove it entirely, as the Zephyr docs state it's necessary.

Second, showZephyrPythonNotFoundError() currently says:

Zephyr requires exactly Python 3.12 — other versions are not supported.

but the Linux fallback says Python 3.12 is strongly recommended and other versions may work. Could this be described as an extension compatibility pin instead?

Something like:

This extension uses Python 3.12 for the Zephyr environment because required packages may not be available on newer Python releases.

That seems more precise and avoids making a broader claim about every Zephyr configuration.

The Linux wording comes from the Zephyr docs, which state the 3.12 pin is only required on Windows, and is only strongly recommended otherwise.

Python 3.12 is strongly recommended. Using a newer Python release may fail on some systems, for example when installing the required packages on Windows.

Also fixup powershell instructions
Speeds up the search, now the python path isn't being overwritten in settings
@will-v-pi
will-v-pi merged commit bd91930 into main Oct 6, 2026
2 checks passed
@will-v-pi
will-v-pi deleted the zephyr-fixups branch October 6, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants