Skip to content

bug: Models are not being detected as pydantic-model #45

@seriaati

Description

@seriaati

Description of the bug

Models are detected as pydantic-model sometimes but not in sometimes, and I can't seem to find the pattern.

To Reproduce

git clone https://github.com/seriaati/genshin.py
cd genshin.py
git checkout imp/docs
uv sync --group docs
uv run mkdocs serve

in genshin/test_model.py there are two classes for debugging: ExampleModel from the project example and StokenResult from genshin.py itself, you can see that in http://127.0.0.1:8000/genshin.py/reference/models/test/, both models are being detected as pydantic models correctly (by this I mean there's a pydantic-model after the class name, and the fields and validators are shown as in the example.)

Image

However, as soon as the same python file containing the models is moved into the genshin/models directory, the models are suddenly not being detected as pydantic models as seen in http://127.0.0.1:8000/genshin.py/reference/models/test_in_model/

Image

The console had no errors.

Expected behavior

The models in genshin/models should be detected.

Environment information

  • System: Windows-10-10.0.22631-SP0
  • Python: cpython 3.9.20 (C:\Users\Seria\Documents\Repos\genshin.py.venv\Scripts\python.exe)
  • Environment variables:
  • Installed packages:
    • griffe-pydantic v1.1.7

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions