Skip to content

feat(wokwi): Add support for custom chips#419

Merged
hfudev merged 2 commits into
espressif:mainfrom
lucasssvaz:feat/wokwi_custom_chips
May 14, 2026
Merged

feat(wokwi): Add support for custom chips#419
hfudev merged 2 commits into
espressif:mainfrom
lucasssvaz:feat/wokwi_custom_chips

Conversation

@lucasssvaz
Copy link
Copy Markdown
Member

Description

This pull request adds support for uploading custom chips to the Wokwi simulator by reading chip definitions from a wokwi.toml file or by auto-detecting chip files in a chips/ directory. It also adds compatibility for Python versions below 3.11 by conditionally importing the appropriate TOML parsing library.

Custom chip upload support:

  • Added logic to upload custom chips before uploading the diagram, ensuring chip references in the diagram are resolved at upload time. Custom chips can be defined in a wokwi.toml file or auto-detected from a chips/ directory. (pytest_embedded_wokwi/wokwi.py)
  • Implemented helper methods (_upload_custom_chips, _chip_specs_from_toml, _chip_specs_from_dir, and _upload_chip_specs) to handle parsing chip definitions, locating chip files, and uploading them to the Wokwi server. (pytest_embedded_wokwi/wokwi.py)

Python version compatibility:

  • Added conditional import of tomllib for Python 3.11+ and tomli for earlier versions, ensuring TOML files can be parsed regardless of Python version. (pytest_embedded_wokwi/wokwi.py)
  • Updated dependencies to include tomli for Python versions below 3.11. (pytest-embedded-wokwi/pyproject.toml)

Testing

Tested locally with a custom SPI chip

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Title Coverage Tests Skipped Failures Errors Time
3.14 X64 Coverage 103 16 💤 0 ❌ 0 🔥 13m 24s ⏱️
3.10 ARM64 Coverage 103 18 💤 1 ❌ 0 🔥 10m 34s ⏱️
Qemu Coverage 7 0 💤 0 ❌ 0 🔥 25.150s ⏱️

Copy link
Copy Markdown
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you

@hfudev hfudev merged commit 62edc22 into espressif:main May 14, 2026
5 of 6 checks passed
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.

2 participants