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

Enable strict and disable "ignore missing imports" where viable #117

Open
jaraco opened this issue Mar 30, 2024 · 3 comments
Open

Enable strict and disable "ignore missing imports" where viable #117

jaraco opened this issue Mar 30, 2024 · 3 comments

Comments

@jaraco
Copy link
Owner

jaraco commented Mar 30, 2024

one-size-fits-all seems to me to be a strange goal for mypy configuration. Different projects will have different imports: some of which will have complete type stubs, some of which will have partial type stubs, some of which will have none.

I would recommend that you go strict everywhere, and ignore missing imports explicitly for specific packages as needed, rather than unconditionally ignore-missing-imports. That makes it clearer what is going on and - as here, perhaps! - encourages contributions to dependencies that are nearly well-typed.

Originally posted by @dimbleby in jaraco/jaraco.classes#13 (comment)

@jaraco
Copy link
Owner Author

jaraco commented Mar 30, 2024

That's fair. When skeleton projects originally started adopting typing and mypy, almost nothing would pass without the settings currently in place. Now at least some projects are able to adopt more strict settings.

One goal of skeleton is to limit the toil of once per project changes, so I'll explore how viable either of these settings might be across all of the projects:

ignore_missing_imports = False
strict = True

@jaraco
Copy link
Owner Author

jaraco commented Mar 30, 2024

I'm running this command to get an idea of how extensive is the reliance on the ignore_missing_imports setting:

pip-run jaraco.develop -- -m jaraco.develop.projects-run -t 'not fork' -- bash -c 'sed -i -e /ignore_missing_imports/d mypy.ini; tox -- -p no:cov -k mypy'

results

@Avasam
Copy link
Contributor

Avasam commented Jul 30, 2024

I just saw this issue after creating #136
Whilst I agree that strict by default ought to be the norm, most jaraco / skeleton-based projects are too far to be ready. Most aren't even marked py.typed ! (ref: #98 (comment)) So in that PR I went with non-strict but a few useful checks still turned on.

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

No branches or pull requests

2 participants