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

MAINT: Clean up type: ignore comments related to third-party packages #15625

Merged
merged 5 commits into from
Mar 8, 2022

Conversation

BvB93
Copy link
Contributor

@BvB93 BvB93 commented Feb 19, 2022

Currently a number of # type: ignore[import] comments are scattered throughout the codebase due to third-party packages that lack type annotations. As they provide a reasonable amount of visual clutter, this PR attempts to remove them and deal with the fallout using one of two approaches:

  • Installing the third party package. Note that this option is only viable if the package in question distributes type annotations (or has a matching stub-only package, e.g. types-psutil).
  • Globally enabling the ignore_missing_imports option for the package in mypy.ini.

@BvB93 BvB93 added maintenance Items related to regular maintenance tasks static typing Items related to static typing labels Feb 19, 2022
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read through the diff and the cleanup looks useful.

My only concern is the comment I added for pyproject.toml where there may be a bit of duplication.

pyproject.toml Outdated Show resolved Hide resolved
import cPickle as pickle
except ImportError:
import pickle
import pickle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, leftovers from Python 2.7!

@rgommers rgommers closed this Mar 8, 2022
@rgommers rgommers reopened this Mar 8, 2022
@rgommers rgommers added this to the 1.9.0 milestone Mar 8, 2022
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks @BvB93.

The failing CI job is due to the doc build no longer doing LaTeX - unrelated to this PR and already resolved in main. So in it goes.

@rgommers rgommers merged commit 6f5290b into scipy:main Mar 8, 2022
@BvB93 BvB93 deleted the ignore branch March 8, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks static typing Items related to static typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants