JetBrains / intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
https://plugins.jetbrains.com/plugin/9777-micropython
Apache License 2.0
506 stars 106 forks source link

[Feature] Extract board stubs to pypi packages #179

Open mrkeuz opened 2 years ago

mrkeuz commented 2 years ago

According PEP-0561, stubs can be distributed via pip.

It would be good to publish stub packages to pip for easy installation just via pip. There is another team that tried to support similar versions of stubs micropython-stubs but in auto-generated manner.

I have created similar issue #123. It would be good to join forces and extract stubs to common project, for ability deploying them to PyPi and support by community together. It brings ability to use this stubs in linters, and other tools. Also, this allows for involving more community contributions, in my humble opinion.

Sincerely to JetBrains team and contributors! 🚀

vlasovskikh commented 2 years ago

I like this idea. We can modify the plugin to require installing these stubs for your device type similarly to what we already do for dependencies for communication with your device.

See https://github.com/vlasovskikh/intellij-micropython/blob/a068a81922151686142d01d93d4375c836ed92e6/src/main/kotlin/com/jetbrains/micropython/devices/PyboardDeviceProvider.kt#L50 as an example.

vlasovskikh commented 2 years ago

cc @hlovatt you might be interested in this as a stubs contributor.

hlovatt commented 2 years ago

Sorry it took me so long to respond to this. It's a great idea. Took me a while battling PyPI to get something that works!

You can now install from PyPI:

    pip install --upgrade micropython-typesheds
    python -m micropython-typesheds <destination-directory>
Josverl commented 1 year ago

for recent stubs : https://github.com/Josverl/micropython-stubs or Micropython stub packages on PyPI