- This and sister repos
- Structure of this repo
- Naming Convention and Stub folder structure
- 2 python versions
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 |
- recommended is to create a symlink from `develop/micropython-stubber\all-stubs` to `develop/micropython-stubs`
- For Git submodules please refer to https://git-scm.com/book/en/v2/Git-Tools-Submodules
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/* | |
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
To create the symbolic link to the ../micropython-stubs/stubs
folder the instructions differ slightly for each OS/
The below examples assume that the micropython-stubs repo is cloned 'next-to' your project folder.
please adjust as needed.
Requires Developer enabled
or elevated powershell prompt.
# target must be an absolute path, resolve path is used to resolve the relative path to absolute
New-Item -ItemType SymbolicLink -Path "all-stubs" -Target (Resolve-Path -Path ../micropython-stubs/stubs)
or use mklink in an (elevated) command prompt
rem target must be an absolute path
mklink /d all-stubs c:\develop\micropython-stubs\stubs
# target must be an absolute path
ln -s /path/to/micropython-stubs/stubs all-stubs