Open ddribin opened 2 weeks ago
Hi, I maintain the micropython-stubs repo with typestubs of quite a few of the micropython ports and boards. I would be interested in collaboration to:
just @mention me if you are interested, and we can figure out how to make that work.
Assuming you are using vscode and pylance the below setup should get you started by setting up a sparce clone of just (one of) the typing folder(s) in this repo:
To clone just the lang/en folder from the https://github.com/microbit-foundation/micropython-microbit-stubs repository using the sparse-checkout feature of Git.
Assuming you have a folder for you project called: project_foo
cd project_foo
mkdir typings
cd typings
git init
git remote add -f origin https://github.com/microbit-foundation/micropython-microbit-stubs.git
git config core.sparseCheckout true
echo "lang/en" >> .git/info/sparse-checkout
git pull origin main
cd ..
code .
@Josverl Thanks for the response! I've tried what you wrote, and the copied candle.py
from this repo to the top-level:
> tree -F -L 5
./
├── candle.py
└── typings/
└── lang/
└── en/
└── typeshed/
└── stdlib/
Unfortunately, I still get red squiggles in VS Code on the from microbit import *
line:
The red squiggles are coming from the Flake8
VS Code plugin. If I disable that plugin for the workspace, then it does appear to be working. Thanks! I can make this work, though it would be super helpful if this were pip
installable.
Hi. This is more of a question than an issue, but is it possible to use these stubs if coding locally in Visual Studio Code? And if so, do you have any pointers as to how that would work?
Thanks! My kids have learned how to use the micro:bit in their school, and have really enjoyed it!