Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark pydantic integration (as an extra?) #385

Open
cburroughs opened this issue Dec 11, 2023 · 2 comments
Open

mark pydantic integration (as an extra?) #385

cburroughs opened this issue Dec 11, 2023 · 2 comments
Labels
good first issue Good for newcomers

Comments

@cburroughs
Copy link

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.

@pjbull
Copy link
Member

pjbull commented Dec 20, 2023

I'm kind of on the fence about the value of adding an extra here. Would it work for us just to add type ignore at that import line? We don't actually use any of the pydantic types.

@pjbull pjbull added the good first issue Good for newcomers label May 25, 2024
@pjbull
Copy link
Member

pjbull commented May 25, 2024

Let's go with the ignore fix here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants