diff --git a/setup.cfg b/setup.cfg index cb6d790a961..cd5a2b256d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,81 +26,6 @@ ignore = W504 follow_imports = silent ignore_missing_imports = True -[mypy-pip/_internal/build_env] -strict_optional = False - -[mypy-pip/_internal/cache] -strict_optional = False - -[mypy-pip/_internal/cli/base_command] -strict_optional = False - -[mypy-pip/_internal/cli/cmdoptions] -strict_optional = False - -[mypy-pip/_internal/configuration] -strict_optional = False - -[mypy-pip/_internal/index] -strict_optional = False - -[mypy-pip/_internal/legacy_resolve] -strict_optional = False - -[mypy-pip/_internal/locations] -strict_optional = False - -[mypy-pip/_internal/models/format_control] -strict_optional = False - -[mypy-pip/_internal/operations/check] -strict_optional = False - -[mypy-pip/_internal/operations/freeze] -strict_optional = False - -[mypy-pip/_internal/operations/prepare] -strict_optional = False - -[mypy-pip/_internal/pep425tags] -strict_optional = False - -[mypy-pip/_internal/req/*] -disallow_untyped_defs = True - -[mypy-pip/_internal/req] -strict_optional = False - -[mypy-pip/_internal/req/constructors] -strict_optional = False - -[mypy-pip/_internal/req/req_file] -strict_optional = False - -[mypy-pip/_internal/req/req_install] -strict_optional = False - -[mypy-pip/_internal/req/req_set] -strict_optional = False - -[mypy-pip/_internal/req/req_tracker] -strict_optional = False - -[mypy-pip/_internal/utils/encoding] -strict_optional = False - -[mypy-pip/_internal/utils/glibc] -strict_optional = False - -[mypy-pip/_internal/utils/misc] -strict_optional = False - -[mypy-pip/_internal/utils/ui] -strict_optional = False - -[mypy-pip/_internal/wheel] -strict_optional = False - [mypy-pip/_vendor/*] follow_imports = skip ignore_errors = True diff --git a/src/pip/_internal/build_env.py b/src/pip/_internal/build_env.py index a060ceea2ca..5decc91050e 100644 --- a/src/pip/_internal/build_env.py +++ b/src/pip/_internal/build_env.py @@ -1,6 +1,9 @@ """Build Environment used for isolation during sdist building """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import logging import os import sys diff --git a/src/pip/_internal/cache.py b/src/pip/_internal/cache.py index 894624c1dbc..0e893cd45a7 100644 --- a/src/pip/_internal/cache.py +++ b/src/pip/_internal/cache.py @@ -1,6 +1,9 @@ """Cache Management """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import errno import hashlib import logging diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index fd771b1412c..2ba19f944b0 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -1,4 +1,8 @@ """Base Command class, and related routines""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import, print_function import logging diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index ecf4d20bcd6..ea4d4de5cb1 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -5,8 +5,11 @@ globally. One reason being that options with action='append' can carry state between parses. pip parses general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this design. - """ + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import logging diff --git a/src/pip/_internal/configuration.py b/src/pip/_internal/configuration.py index 10edb4829ab..6843557855f 100644 --- a/src/pip/_internal/configuration.py +++ b/src/pip/_internal/configuration.py @@ -11,6 +11,9 @@ A single word describing where the configuration key-value pair came from """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import locale import logging import os diff --git a/src/pip/_internal/index.py b/src/pip/_internal/index.py index 75fd4e005ff..c5bc3bc3428 100644 --- a/src/pip/_internal/index.py +++ b/src/pip/_internal/index.py @@ -1,4 +1,8 @@ """Routines related to PyPI, indexes""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import cgi diff --git a/src/pip/_internal/legacy_resolve.py b/src/pip/_internal/legacy_resolve.py index 2f629b39d11..f52db418b21 100644 --- a/src/pip/_internal/legacy_resolve.py +++ b/src/pip/_internal/legacy_resolve.py @@ -10,6 +10,9 @@ a. "first found, wins" (where the order is breadth first) """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import logging import sys from collections import defaultdict diff --git a/src/pip/_internal/locations.py b/src/pip/_internal/locations.py index 5f843d797c4..7fbc0ad8907 100644 --- a/src/pip/_internal/locations.py +++ b/src/pip/_internal/locations.py @@ -1,4 +1,8 @@ """Locations where we look for configs, install stuff, etc""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import os diff --git a/src/pip/_internal/models/format_control.py b/src/pip/_internal/models/format_control.py index 53138e48eca..c08c30f83f9 100644 --- a/src/pip/_internal/models/format_control.py +++ b/src/pip/_internal/models/format_control.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from pip._vendor.packaging.utils import canonicalize_name from pip._internal.utils.typing import MYPY_CHECK_RUNNING diff --git a/src/pip/_internal/operations/check.py b/src/pip/_internal/operations/check.py index 7b8b369fc90..3bc9f8107ea 100644 --- a/src/pip/_internal/operations/check.py +++ b/src/pip/_internal/operations/check.py @@ -1,6 +1,9 @@ """Validation of dependencies of packages """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import logging from collections import namedtuple diff --git a/src/pip/_internal/operations/freeze.py b/src/pip/_internal/operations/freeze.py index b4193730a03..6eaa85b19ec 100644 --- a/src/pip/_internal/operations/freeze.py +++ b/src/pip/_internal/operations/freeze.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import collections diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index 471a60ce828..2449e8efc28 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -1,6 +1,9 @@ """Prepares a distribution for installation """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import logging import os diff --git a/src/pip/_internal/req/__init__.py b/src/pip/_internal/req/__init__.py index c39f63fa831..9955a716ce2 100644 --- a/src/pip/_internal/req/__init__.py +++ b/src/pip/_internal/req/__init__.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import logging diff --git a/src/pip/_internal/req/constructors.py b/src/pip/_internal/req/constructors.py index cd0ab504282..28cef933221 100644 --- a/src/pip/_internal/req/constructors.py +++ b/src/pip/_internal/req/constructors.py @@ -8,6 +8,9 @@ InstallRequirement. """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import logging import os import re diff --git a/src/pip/_internal/req/req_file.py b/src/pip/_internal/req/req_file.py index 3e39f9603ed..65772b20a83 100644 --- a/src/pip/_internal/req/req_file.py +++ b/src/pip/_internal/req/req_file.py @@ -2,6 +2,9 @@ Requirements file parsing """ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import optparse diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 9c0e69a0bd7..4752fa88816 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import logging diff --git a/src/pip/_internal/req/req_set.py b/src/pip/_internal/req/req_set.py index d1966a4aa9c..0b81ed215b0 100644 --- a/src/pip/_internal/req/req_set.py +++ b/src/pip/_internal/req/req_set.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import logging diff --git a/src/pip/_internal/req/req_tracker.py b/src/pip/_internal/req/req_tracker.py index e36a3f6b5c2..bef30f236af 100644 --- a/src/pip/_internal/req/req_tracker.py +++ b/src/pip/_internal/req/req_tracker.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import contextlib diff --git a/src/pip/_internal/utils/encoding.py b/src/pip/_internal/utils/encoding.py index 30139f2e591..ab4d4b98e3e 100644 --- a/src/pip/_internal/utils/encoding.py +++ b/src/pip/_internal/utils/encoding.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + import codecs import locale import re diff --git a/src/pip/_internal/utils/glibc.py b/src/pip/_internal/utils/glibc.py index aa77d9b60f8..544b4c2792b 100644 --- a/src/pip/_internal/utils/glibc.py +++ b/src/pip/_internal/utils/glibc.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import os diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py index a08669a4b85..33b0653a0a8 100644 --- a/src/pip/_internal/utils/misc.py +++ b/src/pip/_internal/utils/misc.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import contextlib diff --git a/src/pip/_internal/utils/ui.py b/src/pip/_internal/utils/ui.py index 46390f4a598..80cdab37912 100644 --- a/src/pip/_internal/utils/ui.py +++ b/src/pip/_internal/utils/ui.py @@ -1,3 +1,6 @@ +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import, division import contextlib diff --git a/src/pip/_internal/wheel.py b/src/pip/_internal/wheel.py index b59094fdfbd..35c73210bbf 100644 --- a/src/pip/_internal/wheel.py +++ b/src/pip/_internal/wheel.py @@ -1,6 +1,10 @@ """ Support for installing and building the "wheel" binary package format. """ + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + from __future__ import absolute_import import collections