drivendataorg / drivendataorg/cloudpathlib

mark pydantic integration (as an extra?)

Open
#385 2 comments 0 reactions 0 assignees View on GitHub
good first issue typing
Dominant language
Python
Stars
628
Forks
88
Avg merge
17h 28m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.