Closed Tonkonozhenko closed 3 years ago
Hi, I've had that error with external libraries as well. I'm not 100% sure what causes that.
Judging by a quick search, and this SO answer, it seems I need to add a py.typed
file somewhere into the package to adhere to PEP 561.
I'm super busy this week, but to fix it you can try this for now:
from typing import Type
from pydantic import BaseModel
from pydantic_yaml import YamlModel # type: ignore
YamlModel: Type[BaseModel]
Obviously not ideal, but I expect this should work for now?
Closed by PR #4 Opened #5 to add tests for this case at some point. :)
@NowanIlfideme unfortunately, needs to reopen.
py.typed file is not included in the package
I checked the installation via pip install -e "git+https://github.com/tonkonozhenko/pydantic-yaml.git@patch-1#egg=pydantic_yaml"
and it worked correctly
Please test this again, I believe I fixed it & some other issues that would've come up. But you have the real-life use case, so it would be a better test. 😉
@NowanIlfideme Now everything works. Thanks a lot!
Hi @NowanIlfideme
I'm trying to use the library with mypy and have next error. Please advice
Regards, Alex