acederberg / pydantic-settings-yaml

A convenient tool for loading pydantic settings from either YAML and JSON.
MIT License
5 stars 3 forks source link

Add support for using the library with mypy #18

Closed ZeeD closed 3 months ago

ZeeD commented 9 months ago

At the moment if I import your module I have

error: Skipping analyzing "yaml_settings_pydantic": module is installed, but missing library stubs or py.typed marker  [import-untyped]
acederberg commented 9 months ago

Hi @ZeeD!

Thank you for using this library. I've reproduced this error in nvim. I'll take care of this. I'm currently occupied but I can get it done. It looks like I just need to add this

[tool.setuptools.package-data]
"pkgname" = ["py.typed"]

to pyproject.toml and add py.typed to the source folder and it should be good to go.

acederberg commented 9 months ago

I added the above and installed the package in editable mode and it works in nvim:

image

Changes are on fix/py-typed. Let me know that it works for you and I'll merge and release it.

ZeeD commented 9 months ago

Hi @acederberg ! thanks for the quick response and the changes! yeah, it should be good with just the py.typed in the published package

qs5779 commented 3 months ago

I am not sure why the fix/py-typed branch was never merged, but I just submitting a similar PR

acederberg commented 3 months ago

I thought I had fixed this, sorry @ZeeD! It is now merged in tag 2.3.1.