platformio / platformio-docs

PlatformIO Documentation
https://docs.platformio.org
Apache License 2.0
243 stars 326 forks source link

Python scripts have warnings `Import("env")` is not defined #342

Closed AgainPsychoX closed 7 months ago

AgainPsychoX commented 7 months ago

Python scripts are super useful, but I get annoyed by the IDE/Pylance warning about Import("env") and env being not defined:

image

Is there a way to do something about it? Maybe some dummy python package (PlatformIO-related) that I could "import" the Import and env?

ivankravets commented 7 months ago

Duplicate of https://community.platformio.org/t/import-is-not-defined-pylance-for-extra-scripts/35570/8?u=ivankravets

AgainPsychoX commented 6 months ago

Wouldn't it be better to have valid typings? Also, I have multiple lines with env used, so I need to add a lot of # type: ignore which makes everything ugly and type checking on those lines useless...