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

Use mypy's default of strict_optional=True #6704

Merged
merged 7 commits into from
Jul 15, 2019

Conversation

cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Jul 13, 2019

This PR changes our setup.cfg to use mypy's default of strict_optional=True. Instead, the list of files exempted from this default are explicitly listed. This is nice for a few reasons: (1) files adhering to strict_optional=True now get checked, so it prevents regressions, (2) new files added automatically use strict_optional=True (because it's the default), and (3) it provides a list that we can see of which files still need to be converted, which gives us an actionable check-list of TODO's.

This PR also converts four files over to use strict_optional (one commit for each one).

Refs: #4748 (umbrella issue)

@cjerdonek cjerdonek changed the title Us mypy's default Use mypy's default of strict_optional=True Jul 13, 2019
@cjerdonek cjerdonek added skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes labels Jul 13, 2019
@pradyunsg
Copy link
Member

I like the approach here!

Makes it even clearer what our progress in this issue is. :)

src/pip/_internal/utils/logging.py Show resolved Hide resolved
src/pip/_internal/utils/logging.py Outdated Show resolved Hide resolved
@cjerdonek cjerdonek force-pushed the mypy-per-file-strict-optional branch from 6da396f to 190ea6a Compare July 15, 2019 06:09
@cjerdonek cjerdonek merged commit 90905fc into pypa:master Jul 15, 2019
@cjerdonek cjerdonek deleted the mypy-per-file-strict-optional branch July 15, 2019 10:41
@cjerdonek cjerdonek mentioned this pull request Jul 15, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants