pirxthepilot / wtfis

Passive hostname, domain and IP lookup tool for non-robots
MIT License
889 stars 47 forks source link

Please add support for pydantic-2 #48

Closed mgorny closed 1 year ago

mgorny commented 1 year ago

The package currently requires pydantic-1. Please add support for pydantic-2. FWICS it would require some code changes:

ImportError while loading conftest '/tmp/wtfis/tests/conftest.py'.
tests/conftest.py:8: in <module>
    from wtfis.models.greynoise import GreynoiseIp
wtfis/models/greynoise.py:18: in <module>
    class GreynoiseIpMap(BaseModel):
.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py:95: in __new__
    private_attributes = inspect_namespace(
.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py:279: in inspect_namespace
    raise TypeError("To define root models, use `pydantic.RootModel` rather than a field called '__root__'")
E   TypeError: To define root models, use `pydantic.RootModel` rather than a field called '__root__'
pirxthepilot commented 1 year ago

Thanks for the heads up! I will fix soon.

pirxthepilot commented 1 year ago

Latest version v0.6.2 is on pydantic 2.

mgorny commented 1 year ago

Thank you!