felix-martel / pydanclick

Add click options from a Pydantic model
https://felix-martel.github.io/pydanclick/
MIT License
32 stars 8 forks source link

griffe not working #31

Closed rectalogic closed 3 weeks ago

rectalogic commented 3 weeks ago

First, the docs say install pydanclick[griffe] but that fails:

$ pip install pydanclick[griffe]
WARNING: pydanclick 0.3.0 does not provide the extra 'griffe'

So I manually install griffe, but then pydanclick parse_attribute_documentation tries to import this:

https://github.com/felix-martel/pydanclick/blob/e0d762f5983804d8716810304db57291a6e5982f/pydanclick/model/docstrings.py#L30-L31

which fails and so griffe is disabled:

>>> from griffe.dataclasses import Docstring
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from griffe.dataclasses import Docstring
ModuleNotFoundError: No module named 'griffe.dataclasses'

I'm guessing an older version of griffe had griffe.dataclasses and so the missing pydanclick[griffe] extra should constrain the griffe version to the working version?

felix-martel commented 3 weeks ago

Yep, looks like a mistake on my side, I'll look into it. Thanks for the report!