pydantic / logfire

Uncomplicated Observability for Python and beyond! 🪵🔥
https://logfire.pydantic.dev/docs/
MIT License
2.08k stars 62 forks source link

`test_logfire_api` doesn't look at `logfire_api.__all__` #335

Open alexmojaki opened 2 months ago

alexmojaki commented 2 months ago

It just uses logfire.__all__ in both versions of test_runtime. logfire_api.__all__ doesn't actually exist at runtime when logfire isn't importable.

Kludex commented 2 months ago

Is this a problem on PyCharm? I only see PyCharm users caring about __all__ (not saying is not important, just trying to understand).

alexmojaki commented 2 months ago

I'm not sure I understand the importance of __all__ either, but it seems like it matters, e.g. https://github.com/alexmojaki/pure_eval/pull/20

Presumably I'm supposed to keep __all__ and the other contents of logfire_api/__init__.pyi up to date. The tests make it look like they're checking that, and that they'll fail if I forget. So it's a bit worrying that I can actually delete everything inside the file and the tests still pass.

Kludex commented 2 months ago

I'm not sure I understand the importance of all either, but it seems like it matters, e.g. https://github.com/alexmojaki/pure_eval/pull/20

What the user said about pyright is not correct. I use pyright in strict mode on VSCode.