drivendataorg/cloudpathlib

mark pydantic integration (as an extra?)

開放

#385 建立於 2023年12月11日

 (2 則留言) (0 個反應) (0 位負責人)Python (87 個分叉)auto 404
good first issuetyping

倉庫指標

星標
 (624 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

We run mypy with ignore_missing_imports = false and then have an explicit allow list for packages. Since cloudpathlib imports pydantic (albeit behind a guard) but does not depends on it, mypy fails with :

cloudpath.py:1207: error: Cannot find implementation or library stub for module named "pydantic_core"  [import-not-found]

We would normally set ignore_missing_imports for just pydantic_core, but that's somewhat wonky in this case because pydantic_core does have type stubs, it's just not a dependency.

I think the most straightforward approach would be to add a pydantic extra to cloudpathlib, but there might be a fancier way to inform mypy directly of the "optional-ness" of the imports.

貢獻者指南