jmosbacher / pydantic-panel

Edit pydantic models with widgets from the awesome Panel package
MIT License
24 stars 3 forks source link

Make editors and linters not complain about unused imports #14

Closed MarcSkovMadsen closed 11 months ago

MarcSkovMadsen commented 2 years ago

It is friction that editors and linters will complain about unused imports

image image

The solution could be as simple as adding some disabling comment like # noqa to the documentation. But unfortunately # noqa does not work for pylint and pyright. Some solution that works across linters and editors would be nice.

Maybe the import should be different. Like for example?

import pydantic_panel as pp
pp.extension()
MarcSkovMadsen commented 2 years ago

Another solution could be to support, document or even favor using

from pydantic_panel import Pydantic
widget=Pydantic(SomePydanticModel)
jmosbacher commented 2 years ago

I really like this idea

import pydantic_panel as pp
pp.extension()

as it will also allow us to take in some options to configure the behavior of these extensions. I think I will implement this very soon.