Repo structure

This and sister repos

repo

Why

Where

example

micropython-stubber

needed to make stubs

in your source folder

develop/micropython-stubber

micropython

to collect frozen modules

submodule of micropython-stubber

develop/micropython-stubber/micropython

micropython-lib

to collect frozen modules

submodule of micropython-stubber

develop/micropython-stubber/micropython-lib

micropython-stubs

stores collected stubs

next to the stubber

develop/micropython-stubs

Note

  • recommended is to create a symlink from develop/micropython-stubber\all-stubs to develop/micropython-stubs

Note

  • For Git submodules please refer to https://git-scm.com/book/en/v2/Git-Tools-Submodules

Structure of this repo

The file structure is based on my personal windows environment, but you should be able to adapt that without much hardship to you own preference and OS.

What

Details

Where

stub root

symlink to connect the 2 sister-repos

all_stubs

firmware stubber

MicroPython

board/createstubs.py

minified firmware stubber

MicroPython

minified/createstubs.py

PC based scripts

CPython

src/*

PC based scripts

CPython

process.py

pytest tests

test/*

Naming Convention and Stub folder structure

What

Why

Where

stub root

connect the 2 repos

all_stubs

cpython stubs for micropython core

adapt for differences between CPython and MicroPython

stubs/cpython-core

generated stub files

needed to use stubs

stubs/{firmware}-{port}-{version}-frozen

Frozen stub files

better code intellisense

stubs/{firmware}-{version}-frozen

Note: I found that, for me, using submodules caused more problems than it solved. So instead I link the two main repo’s using a symlink.

Note: I in the repo tests I have used the folders TESTREPO-micropython and TESTREPO-micropython-lib to avoid conflicts with any development that you might be doing on similar micropython repos at the potential cost of a little disk space.

cd /develop 

git clone  https://github.com/josverl/micropython-stubber.git 
git clone  https://github.com/josverl/micropython-stubs.git 
git clone  https://github.com/micropython/micropython.git 
git clone  https://github.com/micropython/micropython.git