Skip to content

fix(wokwi): support wokwi-client 0.4.0 - #403

Merged
hfudev merged 2 commits into
mainfrom
fix/wokwi-firmware
Feb 26, 2026
Merged

fix(wokwi): support wokwi-client 0.4.0#403
hfudev merged 2 commits into
mainfrom
fix/wokwi-firmware

Conversation

@hfudev

@hfudev hfudev commented Feb 26, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the pytest-embedded-wokwi plugin to support wokwi-client version 0.4.0 by adapting to the new API and removing deprecated version checking code.

Changes:

  • Updated wokwi-client dependency from >=0.2.0 to >=0.4.0
  • Removed version compatibility checking code and WOKWI_CLI_MINIMUM_VERSION constant
  • Updated file upload and simulation initialization to use new wokwi-client 0.4.0 API methods

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pytest-embedded-wokwi/pyproject.toml Updated wokwi-client minimum version requirement from 0.2.0 to 0.4.0
pytest-embedded-wokwi/pytest_embedded_wokwi/init.py Removed WOKWI_CLI_MINIMUM_VERSION constant and cleaned up import statements
pytest-embedded-wokwi/pytest_embedded_wokwi/wokwi.py Removed version checking logic and packaging import; updated API calls to use Path objects and new upload_idf_firmware method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hfudev

hfudev commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

Hi @urish I noticed errors like https://github.com/espressif/pytest-embedded/actions/runs/22448984330/job/65011684261#step:6:12904 since wokwi-client 0.4.0 released.

  /usr/local/lib/python3.14/site-packages/wokwi_client/transport.py:140: RuntimeWarning: Background recv error: Server error 1: Firmware file pytest.bin appears to contain source code, not compiled firmware. See: https://docs.wokwi.com/vscode/migrating

This PR is to fix the upload. PTAL, thanks.

@github-actions

github-actions Bot commented Feb 26, 2026

Copy link
Copy Markdown
Title Coverage Tests Skipped Failures Errors Time
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 25.166s ⏱️
3.14 X64 Coverage 103 14 💤 0 ❌ 0 🔥 14m 1s ⏱️
3.10 ARM64 Coverage 103 16 💤 0 ❌ 0 🔥 11m 38s ⏱️

@urish

urish commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

@hfudev and was the .bin file actually a compiled firmware file? or something like flasher_args.json?

@hfudev

hfudev commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

@hfudev and was the .bin file actually a compiled firmware file? or something like flasher_args.json

firmware_path = Path(flasher_args).as_posix()

I think it's path to the flasher_args.json

@urish

urish commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

But you are calling upload_idf_firmware(), so it should handle that for you: https://github.com/wokwi/wokwi-python-client/blob/419d9d45cac33e464fc6f082b98768f90f2fbebb/src/wokwi_client/idf.py#L36

Do you still get this error when using upload_idf_firmware()?

@hfudev
hfudev force-pushed the fix/wokwi-firmware branch from 72b5f35 to 560ca69 Compare February 26, 2026 18:47
@hfudev
hfudev force-pushed the fix/wokwi-firmware branch from 560ca69 to 6dbc86c Compare February 26, 2026 18:48
@hfudev

hfudev commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

@urish after the first try, I got different errors. Now I understand the problem better.

arduino and idf has different layout. arduino firmware_path points to the .bin file, and idf firmware_path points to the flasher_args.json.

The tests passed locally. PTAL 6dbc86c. Thank you.

@hfudev
hfudev merged commit 6e9d666 into main Feb 26, 2026
6 checks passed
@hfudev
hfudev deleted the fix/wokwi-firmware branch February 26, 2026 19:10
@urish

urish commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

The tests passed locally. PTAL 6dbc86c. Thank you.

Added two comments for the commit:

  1. passing flash size to start_simulation (i.e. self.client.start_simulation(firmware.firmware, elf='pytest.elf', flash_size=firmware.flash_size))
  2. The "Starting simulation..." message is actually printed after simulation has already started (cosmetic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants