Comments (2)
As discussed in Discord with @Josverl, but for anyone else who might be following this, I've been working this week on converting the "source of truth" for the built-in MicroPython modules to stub files, using the micropython-stubber generated stubs as a starting point.
This is inspired by the Pybricks project, where their Sphinx documentation is generated from their stubs. See e.g. https://github.com/pybricks/pybricks-api/blob/master/src/pybricks/hubs.py which generates https://docs.pybricks.com/en/stable/hubs/index.html
So going forward, the main MicroPython repo will include stub files containing full type annotations, positional/kw arg indicators, overloads, and doc strings (now updated to be in "Google" format as supported by the Sphinx "napoleon" plugin), as well as annotations about which ports/boards/configurations given modules/classes/methods are supported on. I am also looking at including an "added in version" annotation. Initially this will include stdlib & micropython-specific built-ins (i.e. everything we currently have documentation for), and will eventually grow to include all of micropython-lib.
These stubs should be able to be used directly, but also as a machine-readable input to a project like this that publishes stubs for general use. For example, Pybricks also do this (using "jedi") to convert "Google" to "NumPy" docstrings. One thing you could do for example is filter the stubs to only include what's relevant for a given port/board.
I'll post a WIP PR in the next week or so and update this issue. It's slow progress, 5 modules done, ~85 to go.
from micropython-stubber.
Looking forward to seeing the initial versions
from micropython-stubber.
Related Issues (20)
- Find simple way to add more documentation by the community
- update src/stubber/tools/manifestfile.py from Micropython repo
- Add disk backed cache - and find/fix other startup delays.
- docstubs to use ...
- MicroPython documentation is not available for all Patch versions, causing broken links
- Add sample for mpy escaping
- Pin and Signal should be callable
- MPFlash unnecessarily verbose error message HOT 2
- MPFlash list output doesn't fit a standard terminal HOT 4
- mpflash: rp2 download fails HOT 3
- Mpflash error flashing blank esp32
- Mpflash error flashing. UF2 on macos HOT 1
- MPflash: unable to flash rp2040 /.uf2 on macos HOT 13
- mpflash: does not identify 'ESP32 module with ESP32' v1.13 HOT 1
- mpflash: Failing flash without --serial HOT 4
- mpflash: Improve HTTP error handling HOT 3
- Mpflash - : use 1200 Bd to reset boards to bootloader HOT 2
- Add tls module HOT 1
- mpflash: unable to download PICO firmware due to changed BOARD_ID HOT 4
- mpflash: non-zero return code to indicate no device found HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micropython-stubber.