Skip to content

Commit 9dbe0fa

Browse files
committed
tooling: Add devcontainer for Python/MicroPython development.
1 parent e7996a2 commit 9dbe0fa

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.10
2+
3+
# System packages for firmware build and board communication
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
gcc-arm-none-eabi \
6+
libnewlib-arm-none-eabi \
7+
openocd \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Node.js 20 (for husky, commitlint, lint-staged, semantic-release)
11+
ARG NODE_VERSION=20
12+
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
13+
&& apt-get install -y --no-install-recommends nodejs \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# GitHub CLI
17+
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
18+
| dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
19+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
20+
> /etc/apt/sources.list.d/github-cli.list \
21+
&& apt-get update && apt-get install -y --no-install-recommends gh \
22+
&& rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "STeaMi MicroPython Dev",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"postCreateCommand": "make setup",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"charliermarsh.ruff",
11+
"ms-python.python"
12+
],
13+
"settings": {
14+
"python.defaultInterpreterPath": "/usr/local/bin/python",
15+
"python.testing.pytestEnabled": true,
16+
"python.testing.pytestArgs": ["-v", "-k", "mock"],
17+
"editor.formatOnSave": true,
18+
"[python]": {
19+
"editor.defaultFormatter": "charliermarsh.ruff"
20+
}
21+
}
22+
}
23+
}
24+
}

CONTRIBUTING.md

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

86+
## Dev Container
87+
88+
A dev container is available for VS Code and GitHub Codespaces. It provides Python 3.10, Node.js 20, ruff, pytest, mpremote, arm-none-eabi-gcc, OpenOCD, and the GitHub CLI — everything needed to lint, test, and build firmware.
89+
90+
1. Open the repository in VS Code
91+
2. When prompted, click **Reopen in Container** (or use the command palette: *Dev Containers: Reopen in Container*)
92+
3. The container runs `make setup` automatically on creation
93+
94+
All `make` targets work inside the container. Hardware tests and firmware flashing require USB passthrough to the STeaMi board.
95+
8696
## Workflow
8797

8898
1. Set up your environment: `make setup`

0 commit comments

Comments
 (0)