Skip to content

Commit 076ba07

Browse files
committed
docs: Update CONTRIBUTING with prerequisites and devcontainer docs.
1 parent 396b848 commit 076ba07

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,40 @@ docs: Update README driver table.
8383
test(mcp23009e): Add mock scenarios for mcp23009e driver.
8484
```
8585

86+
## Prerequisites
87+
88+
For local development (without dev container):
89+
90+
* Python 3.10+
91+
* Node.js 22+ (for husky, commitlint, lint-staged, semantic-release)
92+
* `arm-none-eabi-gcc` toolchain (for `make firmware`)
93+
* OpenOCD (for `make deploy`)
94+
* `mpremote` (installed via `pip install -e ".[test]"`)
95+
* GitHub CLI (`gh`)
96+
97+
Then run `make setup` to install all dependencies and git hooks. This creates a `.venv` with ruff, pytest, mpremote, and MicroPython type stubs for Pylance.
98+
99+
## Dev Container
100+
101+
A dev container is available for VS Code and GitHub Codespaces. It includes all prerequisites out of the box: Python 3.10, Node.js 22, ruff, pytest, mpremote, arm-none-eabi-gcc, OpenOCD, and the GitHub CLI.
102+
103+
1. Open the repository in VS Code
104+
2. When prompted, click **Reopen in Container** (or use the command palette: *Dev Containers: Reopen in Container*)
105+
3. The container runs `make setup` automatically on creation
106+
107+
The container also provides:
108+
109+
* **zsh + oh-my-zsh** as default shell with persistent shell history
110+
* **Pylance** configured with MicroPython STM32 stubs (no false `import machine` errors)
111+
* **Serial Monitor** extension for board communication
112+
* **USB passthrough** for mpremote, OpenOCD, and firmware flashing (the container runs in privileged mode with `/dev/bus/usb` mounted)
113+
* **udev rules** for the DAPLink interface (auto-started on container creation)
114+
115+
All `make` targets work inside the container.
116+
86117
## Workflow
87118

88-
1. Set up your environment: `make setup`
119+
1. Set up your environment: open in the dev container, or run `make setup` locally
89120
2. Create a branch from main (format: `feat/`, `fix/`, `docs/`, `tooling/`, `ci/`, `test/`, `style/`, `chore/`, `refactor/`)
90121
3. Write your code and add tests in `tests/scenarios/<driver>.yaml`
91122
4. Run `make ci` to verify everything passes (lint + tests + examples)
@@ -142,7 +173,7 @@ The firmware source is cloned into `.build/micropython-steami/` (gitignored). A
142173

143174
Use `make firmware` for normal rebuilds from the existing local clone. Use `make firmware-update` only when you want to refresh the `micropython-steami` checkout itself or resync the board-specific submodules before rebuilding.
144175

145-
**Requirements**: `arm-none-eabi-gcc` toolchain, OpenOCD for flashing, and `mpremote` for running scripts on the board.
176+
All these tools are included in the dev container. For local development, see the [Prerequisites](#prerequisites) section.
146177

147178
## Notes
148179

0 commit comments

Comments
 (0)