griffe icon indicating copy to clipboard operation
griffe copied to clipboard

Cannot resolve builtin `typing` modules.: `griffe.exceptions.AliasResolutionError: Could not resolve typing.Dict`

Open jessekrubin opened this issue 3 years ago • 3 comments

I get this cryptic message now when I build my docs. No idea why. Dug around the code base and am lost. typing is a built in module so this is super confusing.

griffe.exceptions.AliasResolutionError: Could not resolve typing.Dict
nox > Command mkdocs build failed with exit code 1
nox > Session mkdocs failed.

jessekrubin avatar Jun 03 '22 03:06 jessekrubin

Could you share the full traceback :slightly_smiling_face: ? Also, do you have a public repository that I can use to replicate?

pawamoy avatar Jun 03 '22 17:06 pawamoy

Can do! I am and have been on vacation (now).

Will do when I am back! I copy pasted that error from my phone (fyi) so limited stack.

jessekrubin avatar Jun 15 '22 10:06 jessekrubin

Hi @jessekrubin! Any chance you could share that traceback :smile:? I'm slowly getting back to Griffe after a long and busy time :slightly_smiling_face:

pawamoy avatar Sep 23 '22 18:09 pawamoy

Gentle ping! @jessekrubin

pawamoy avatar Oct 17 '22 19:10 pawamoy

Pinging you again @jessekrubin :grinning: Please let me know if you'd like I stop pinging you :smile:

pawamoy avatar Nov 18 '22 18:11 pawamoy

Oof I just saw your comments! Sorry! I haven't been super python focused lately. I'll take a look this weekend if I have time!

Ps feel free to ping whenever.

jessekrubin avatar Nov 19 '22 00:11 jessekrubin

It's totally fine! Glad to hear from you :smile: I'll ping again in a month :imp:

pawamoy avatar Nov 19 '22 11:11 pawamoy

Actually I fixed a number of alias related issues, so I'll close this for now, feel free to reopen or to open a new issue if you ever encounter it again!

pawamoy avatar Dec 15 '22 18:12 pawamoy

@pawamoy sounds good! I am swamped and my head is in the land of typescript far away from python.

FWIW: I think when I initially reported this bug I think I was trying to use it for my lib xtyping (https://github.com/dynamic-graphics-inc/dgpy-libs/tree/main/libs/xtyping)...

jessekrubin avatar Dec 15 '22 19:12 jessekrubin

Thanks, I'll see if I can replicate using this repo :smile:

pawamoy avatar Dec 15 '22 20:12 pawamoy

Damn, it seems obvious now: it's perfectly normal that aliases to typing (which is an external module, relatively to your own package) are not resolved. But of course it should not crash trying, and it does not crash anymore, so this is indeed fixed :smile:

pawamoy avatar Dec 15 '22 20:12 pawamoy

@pawamoy does it actually resolve to the right place tho?

I wrote xtyping because I was tired of importing typing and typing_extensions and remembering what I had to import from where.

jessekrubin avatar Dec 15 '22 21:12 jessekrubin

It surely picks up the correct location of your imported object, yes. Well, if you ever try again using mkdocstrings/griffe on that project, just let me know how it goes and we'll try to fix any issues arising :slightly_smiling_face:

pawamoy avatar Dec 15 '22 21:12 pawamoy

@pawamoy sounds good! also checkout the rest o my libs in dgpy-libs (if you have time)!

jessekrubin avatar Dec 15 '22 21:12 jessekrubin

Sure, can try to load/dump each one of them with Griffe to see if there's any issue :slightly_smiling_face:

pawamoy avatar Dec 15 '22 21:12 pawamoy

@pawamoy not a bad idea! I was just saying my libs are (IMO) weird and cool! Dumping each lib's docs would be a good test as all of the dgpy-libs libs are fully type annotated!

jessekrubin avatar Dec 15 '22 22:12 jessekrubin

I like funkify :) Lager seems interesting, any docs on what it offers?

pawamoy avatar Dec 15 '22 22:12 pawamoy

@pawamoy it was originally my python-stdlib-logging config and setup and tools, but then I discovered loguru (which is a fantastic package) and lager is really just a collection utils surrounding loguru (with a better name IMO -- it also has super fast json logging ifyou install jsonbourne (in the same repo)).

jessekrubin avatar Dec 16 '22 19:12 jessekrubin