-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Describe the bug
I've tried 2 or 3 times to work out how to use this to generate stubs for a custom micropython build for the RPi Pico W but I'm really struggling!
Here's what I've tried/gleaned so far:
- Some stubs can be generated on the board itself. I've managed to do this - I don't know if it's correct and I don't know where the firmware stubs are stored in the Stubs (https://github.com/Josverl/micropython-stubs) repo)
- There's some docstubs which can be generated from the micropython repository. These get stored in the stubs folder under some some directory called 'micropython--docstubs'
- There's some 'frozen' stubs - I don't know where these come from, I've managed to run get-frozen but don't know where the stubs that are 'got' are stored. I have tried deleting the stubs directory and rerunning
get-frozen
but despite apparent success, no folders seem to be created - There's some 'core' stubs -
get-core
doesn't seem to create a micropython-core directory. - There's merging stubs which produces a new directory with 'merged' in the name. I don't know how or whether this is used in later steps
- There's building the stubs - which uses the frozen and docstubs and maybe the generated stubs from the device. It presumably uses the merged directory? but it also seems to look for the frozen directory?
- There's a specific directory structure I need to check out. According to this I need to check out 4 repositories side-by-side and setup a symlink. But I think that's out of date, according to the docstring here in the github action: https://github.com/Josverl/micropython-stubs/blob/main/.github/workflows/get-all-frozen.yml
My guess for what I should do:
pip install micropython-stubber
- checkout micropython-stubs
- mkdir 'repos' inside micropython-stubs
- checkout micropython & micropython-lib inside repos and checkout to the commit I want to generate stubs for.
- Create a master branch at that commit
- Run build of micropython for my pico w (do I need to do this?)
- install micropython onto the pico w
- Run create_stubs.py on the pico w (is this necessary?)
- copy the generated stubs off the pico and place them into a folder inside micropython-stubs/stubs named
micropython-latest-rp2-RPI_PICO_W
- Run
stubber get-frozen --black --version=latest
stubber get-docstubs
- Run
stubber merge --version latest --board RPI_PICO_W
- Run
stubber build --version latest --port rp2 --board RPI_PICO_W
This just isn't working for me - I'm getting failures about missing frozen stubs and all sorts - I must be doing something fundamentally wrong here or misunderstanding what's already checked in and what needs to be generated
Copilot