Josverl / micropython-stubber

Generate and maintain stubs for different MicroPython ports to use with VSCode and Pylance, PyRight, Thonny, PyCharm or MyPy
https://micropython-stubber.readthedocs.io
Other
172 stars 14 forks source link

docstubs bug : `from __future__ import annotations` #133

Closed Josverl closed 2 years ago

Josverl commented 2 years ago

from __future__ import annotations should be the first line of code

  *** Error compiling 'C:\\develop\\MyPython\\micropython-p1meter\\venv\\Lib\\site-packages\\esp32.py'...
    File "C:\develop\MyPython\micropython-p1meter\venv\Lib\site-packages\esp32.py", line 26
      from __future__ import annotations
      ^
  SyntaxError: from __future__ imports must occur at the beginning of the file

To Reproduce pip install the docstubs

pip install C:\develop\MyPython\esp32-test-stubs\stubs\micropython-v1_17-docstubs -v

Additional context

Need to fid a way to test this ?

Josverl commented 2 years ago

resolved by : https://github.com/Josverl/micropython-stubber/commit/a8e4c4678024dab98f4e722eda92368613da60ea

Josverl commented 2 years ago

confirmed fixed in : https://github.com/Josverl/micropython-stubs/pull/309