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 · 2 comments
Open

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

jaraco opened this issue Mar 30, 2024 · 2 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

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

1 participant