-
Notifications
You must be signed in to change notification settings - Fork 105
Typehints missing classes (ADC, PWM, and probably more) #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@1oglop1 Thanks for trying out the plugin! I've created the stubs in intellij-micropython manually. I was not aware of micropython-stubber, thanks for sharing the link and for suggesting an idea to use it. I believe it will be helpful to get stubs for missing modules or to generate updates for existing stubs. There are however one thing that is better with manually created stubs: I put docstrings into my stubs based on the published docs on MicroPython modules. I find having docs on mouse hover / Ctrl+Q / F1 very helpful. I like the idea of committing stubs generated by micropython-stubber to intellij-micropython. It might also be possible to integrate micropython-stubber so that intellij-micropython invokes it for introspecting new modules for which there are no stubs. I'm open to discussing other ideas on improving the situation with stubs as well. |
Yes the docs via quick docs is one of my motivations to do this as well. I will try the stubber with my ESP32 and let you know as soon as I get some results. |
Hey, Maybe its easier for your work, but as I said before, Ive never did such stubber thing before, I was just interested :D greetings |
@w0nd4bra I haven't use the stubber before as well, if you have managed to get an output it would worth sharing! I may have some time this weekend to play around. |
I can upload the files here on Github if you want. There is nothing special to talk about it,i just want to make you guys to make the plugin better, i cant do it. Just want to use the plugin and pycharm to have some fun with my esp32. Have some ESP-01 laying around, will check later if its the 1mb version or just the 512k one (so i can flash MicroPython). So we have some files for the ESP8266 too. Edit: installed latest micropython on my ESP-01, worked for me. Created a git with all the files the script gave me so far (for the ESP32 and the ESP8266). if u want me to do more, i can try to make it better, cause there is no doc, its just the skeleton. greetings |
@1oglop1 @w0nd4bra I've created a Gitter community chat about the plugin, feel free to join and discuss things. |
Maybe this could help: https://pypi.org/project/micropy-cli/ ? |
I went the road for the least effort for some value and ended up declaring some stubs here: https://github.com/thoastbrot/intellij-micropython/blob/master/typehints/micropython/machine.pyi I did not add documentation yet, as I didn't look up whether the actual API has some or anything... but opening the file in intellij, applying autoformat for the sake of it and copy-pasting APIs from micropython docs and the open python shell... it was worth it. For the lack of docstrings, I did not open a pull request yet. If you feel like adding those, please do so (and open said pull request - I'd be happy to support with code issues). edit: discovered #114 (comment) and how this isn't working out for the differences between ESP32 and ESP8266. Well, stays like this for the time being... |
joining in to request. Without ALL typehints this plugin is more a mock on the users than something useful. |
I'm creating high quality typesheds/stubs including documentation as well as types, see https://github.com/hlovatt/PyBoardTypeshed and then hopefully they will all be included in the Micropython plugin (many of the existing typesheds/stubs in Micropython come from this project). Give me a few weeks and I should have done the complete stack for a PyBoard at least :). |
Have completed a set of typesheds for a PyBoard, see https://github.com/hlovatt/PyBoardTypeshed. This is the complete stack except for the builtins. |
Hi,
I recently started playing with ESP32 and MicroPython.
This plugins looks like a great idea to make things easier however there are some missing modules for ESP8266 and ESP32.
So I did some reading on how this plugin works and found all type hints to be updated 2 years ago, which made me wonder whether they are maintained manually or generated from MicroPython code.
I came across this tool https://github.com/Josverl/micropython-stubber which helps to create pyi files directly on the device itself.
I'm still not sure how to use the stubber, however my idea is to use it to generate stubs and contribute them to this project or to
typeshed
to keep the type hinting up to date with less effort.@vlasovskikh
What do you think about this idea?
Would you be willing to give me a hand to make this happen?
The text was updated successfully, but these errors were encountered: