Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"github.com/PyDevices/lv_circuitpython_mod",
"github.com/PyDevices/lv_cpython_mod",
"github.com/PyDevices/lv_micropython_cmod",
"github.com/PyDevices/micropython-hardware",
"github.com/PyDevices/palettes",
"github.com/PyDevices/pdwidgets",
"github.com/PyDevices/pydisplay",
Expand Down
4 changes: 4 additions & 0 deletions .cursor/skills/pydevices-cloud-handoff/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ description: >-

- Cloud agent works on a branch; review the PR or check out the branch locally.
- **Move to Local** may require an existing local agent for the same repo.
- **Sibling PRs:** the Cursor integration token often cannot open PRs outside
the primary `.github` repo. Agents should use env secret
**`PYDEVICES_GH_TOKEN`** (`export GH_TOKEN="$PYDEVICES_GH_TOKEN"` then
`gh pr create -R PyDevices/<repo> …`). See root **`AGENTS.md`** § GitHub auth.

## If layout looks wrong on the VM

Expand Down
37 changes: 30 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ handing work from Cursor desktop to Cloud Agents.
```
/home/ubuntu/gh/
└── pydevices/
├── cmods -> /agent/repos/cmods
├── dotgithub -> /agent/repos/.github (this repo)
├── PyDevices.github.io -> /agent/repos/PyDevices.github.io
├── palettes -> /agent/repos/palettes
├── pdwidgets -> /agent/repos/pdwidgets
├── pydisplay -> /agent/repos/pydisplay
└── pydisplay_android -> /agent/repos/pydisplay_android
├── cmods -> /agent/repos/cmods
├── dotgithub -> /agent/repos/.github (this repo)
├── micropython-hardware -> /agent/repos/micropython-hardware
├── PyDevices.github.io -> /agent/repos/PyDevices.github.io
├── palettes -> /agent/repos/palettes
├── pdwidgets -> /agent/repos/pdwidgets
├── pydisplay -> /agent/repos/pydisplay
└── pydisplay_android -> /agent/repos/pydisplay_android
```

**Not cloned locally:** `micropython-lib` — GitHub Actions owns sync and
Expand Down Expand Up @@ -134,6 +135,28 @@ When removing paths under `pydevices/` or `cmods/`, delete **symlinks only**
(`rm path` on the link), never `rm -rf` through a symlink into
`/agent/repos/*` unless the intent is to destroy an owned repo.

## GitHub auth — opening PRs on sibling repos

Cloud Agents started from **`PyDevices/.github`** get a Cursor integration
token that can **push** branches into `/agent/repos/*` checkouts, but that
token often **cannot** `createPullRequest` on sibling repos (GraphQL
`Resource not accessible by integration`). `ManagePullRequest` is also bound
to the agent’s primary repo (`.github`), so it will not open PRs on
`graphics`, `pydisplay`, etc.

**Use the workspace secret `PYDEVICES_GH_TOKEN`** (org/admin PAT, injected into
the environment) when creating or updating PRs on any PyDevices sibling:

```bash
export GH_TOKEN="$PYDEVICES_GH_TOKEN"
gh pr create -R PyDevices/<repo> --base main --head <branch> --title "…" --body "…"
# or: gh pr edit … / gh pr ready …
```

Confirm access first if needed: `gh api repos/PyDevices/<repo> --jq .permissions`
should show `"push": true` (and usually `"admin": true`) under that token.
Do **not** rely on the default `gh` login (`cursor` / `ghs_…`) for sibling PRs.

## Related docs

- [cmods AGENTS.md](https://github.com/PyDevices/cmods/blob/main/AGENTS.md) —
Expand Down
4 changes: 2 additions & 2 deletions github-presence.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ keeps the shared org logo.
| [lv_bindings](https://github.com/PyDevices/lv_bindings) | LVGL C→binding generator (source of truth for the native cmods) | [pydevices.github.io/lv_bindings](https://pydevices.github.io/lv_bindings/) |
| [cmods](https://github.com/PyDevices/cmods) | Workspace that builds/smoke-tests the native-module matrix together | [pydevices.github.io/cmods](https://pydevices.github.io/cmods/) |
| [displayif](https://github.com/PyDevices/displayif) | Native display bus/framebuffer modules | [pydevices.github.io/displayif](https://pydevices.github.io/displayif/) |
| [graphics](https://github.com/PyDevices/graphics) | Native FrameBuffer/Area module | [pydevices.github.io/graphics](https://pydevices.github.io/graphics/) |
| [usdl2](https://github.com/PyDevices/usdl2) | Native SDL2 subset for pydisplay's desktop backend | [pydevices.github.io/usdl2](https://pydevices.github.io/usdl2/) |
| [graphics](https://github.com/PyDevices/graphics) | Native (`graphics-cmod`) + pure-Python (`graphics-py`) FrameBuffer/Area | [pydevices.github.io/graphics](https://pydevices.github.io/graphics/) |
| [usdl2](https://github.com/PyDevices/usdl2) | Native (`usdl2`) + pure-Python (`usdl2-py`) SDL2 subset for pydisplay's desktop backend | [pydevices.github.io/usdl2](https://pydevices.github.io/usdl2/) |
| [lv_micropython_cmod](https://github.com/PyDevices/lv_micropython_cmod) | MicroPython user C module glue for LVGL | [pydevices.github.io/lv_micropython_cmod](https://pydevices.github.io/lv_micropython_cmod/) |
| [lv_circuitpython_mod](https://github.com/PyDevices/lv_circuitpython_mod) | CircuitPython integration for LVGL | [pydevices.github.io/lv_circuitpython_mod](https://pydevices.github.io/lv_circuitpython_mod/) |
| [lv_cpython_mod](https://github.com/PyDevices/lv_cpython_mod) | Native CPython LVGL extension (`import lvgl`) | [pydevices.github.io/lv_cpython_mod](https://pydevices.github.io/lv_cpython_mod/) |
Expand Down
4 changes: 3 additions & 1 deletion scripts/cloud-python-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ if bin="$(ensure_venv pydisplay)"; then
# that `import palettes` / `import pdwidgets` resolve in the example matrix.
sp="$("$bin/python" -c 'import site; print(site.getsitepackages()[0])' 2>/dev/null)"
if [[ -n "${sp:-}" ]]; then
printf '%s\n%s\n' "$REPOS/palettes/src" "$REPOS/pdwidgets/src" \
printf '%s\n%s\n%s\n%s\n' \
"$REPOS/palettes/lib" "$REPOS/pdwidgets/lib" "$REPOS/graphics/lib" \
"$REPOS/usdl2/lib" \
> "$sp/pydevices_siblings.pth"
log "wrote $sp/pydevices_siblings.pth"
fi
Expand Down
2 changes: 2 additions & 0 deletions scripts/cloud-workspace-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SIBLINGS=(
lv_circuitpython_mod
lv_cpython_mod
lv_micropython_cmod
micropython-hardware
palettes
pdwidgets
pydisplay
Expand Down Expand Up @@ -234,6 +235,7 @@ clone_missing_siblings || die "one or more sibling clones failed"
link_pydevices cmods "$REPOS/cmods"
link_pydevices dotgithub "$REPOS/.github"
link_pydevices PyDevices.github.io "$REPOS/PyDevices.github.io"
link_pydevices micropython-hardware "$REPOS/micropython-hardware"
link_pydevices palettes "$REPOS/palettes"
link_pydevices pdwidgets "$REPOS/pdwidgets"
link_pydevices pydisplay "$REPOS/pydisplay"
Expand Down