summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kurnikov <maxim.kurnikov@gmail.com>2019-09-28 21:12:49 +0300
committerXavier Fernandez <xav.fernandez@gmail.com>2019-09-29 23:31:15 +0200
commit3692097ccad1b86de657551077bc8aef9502583b (patch)
tree2a31dccfb1342ef576851b8868932b59ee95afca
parent8652923365ec8041ead3f4175508345b8264849a (diff)
downloadpip-3692097ccad1b86de657551077bc8aef9502583b.tar.gz
add per-file disallow_untyped_defs=False, and set it to True globally
-rw-r--r--noxfile.py3
-rw-r--r--setup.cfg1
-rw-r--r--setup.py3
-rw-r--r--src/pip/_internal/build_env.py1
-rw-r--r--src/pip/_internal/cli/autocompletion.py3
-rw-r--r--src/pip/_internal/cli/cmdoptions.py1
-rw-r--r--src/pip/_internal/cli/command_context.py3
-rw-r--r--src/pip/_internal/cli/parser.py4
-rw-r--r--src/pip/_internal/cli/req_command.py3
-rw-r--r--src/pip/_internal/collector.py3
-rw-r--r--src/pip/_internal/commands/__init__.py4
-rw-r--r--src/pip/_internal/commands/check.py3
-rw-r--r--src/pip/_internal/commands/completion.py3
-rw-r--r--src/pip/_internal/commands/configuration.py3
-rw-r--r--src/pip/_internal/commands/debug.py3
-rw-r--r--src/pip/_internal/commands/download.py3
-rw-r--r--src/pip/_internal/commands/freeze.py3
-rw-r--r--src/pip/_internal/commands/hash.py3
-rw-r--r--src/pip/_internal/commands/help.py3
-rw-r--r--src/pip/_internal/commands/install.py1
-rw-r--r--src/pip/_internal/commands/list.py3
-rw-r--r--src/pip/_internal/commands/search.py3
-rw-r--r--src/pip/_internal/commands/show.py3
-rw-r--r--src/pip/_internal/commands/uninstall.py3
-rw-r--r--src/pip/_internal/commands/wheel.py4
-rw-r--r--src/pip/_internal/configuration.py1
-rw-r--r--src/pip/_internal/distributions/base.py3
-rw-r--r--src/pip/_internal/distributions/installed.py3
-rw-r--r--src/pip/_internal/distributions/source/legacy.py3
-rw-r--r--src/pip/_internal/distributions/wheel.py3
-rw-r--r--src/pip/_internal/download.py3
-rw-r--r--src/pip/_internal/exceptions.py4
-rw-r--r--src/pip/_internal/index.py1
-rw-r--r--src/pip/_internal/legacy_resolve.py1
-rw-r--r--src/pip/_internal/locations.py1
-rw-r--r--src/pip/_internal/main.py3
-rw-r--r--src/pip/_internal/models/candidate.py3
-rw-r--r--src/pip/_internal/models/format_control.py1
-rw-r--r--src/pip/_internal/models/link.py3
-rw-r--r--src/pip/_internal/models/search_scope.py3
-rw-r--r--src/pip/_internal/network/auth.py3
-rw-r--r--src/pip/_internal/network/cache.py4
-rw-r--r--src/pip/_internal/network/session.py4
-rw-r--r--src/pip/_internal/operations/check.py1
-rw-r--r--src/pip/_internal/operations/freeze.py1
-rw-r--r--src/pip/_internal/operations/prepare.py1
-rw-r--r--src/pip/_internal/req/constructors.py1
-rw-r--r--src/pip/_internal/req/req_install.py1
-rw-r--r--src/pip/_internal/utils/appdirs.py4
-rw-r--r--src/pip/_internal/utils/compat.py4
-rw-r--r--src/pip/_internal/utils/deprecation.py4
-rw-r--r--src/pip/_internal/utils/hashes.py3
-rw-r--r--src/pip/_internal/utils/logging.py3
-rw-r--r--src/pip/_internal/utils/marker_files.py3
-rw-r--r--src/pip/_internal/utils/misc.py1
-rw-r--r--src/pip/_internal/utils/models.py2
-rw-r--r--src/pip/_internal/utils/outdated.py3
-rw-r--r--src/pip/_internal/utils/temp_dir.py3
-rw-r--r--src/pip/_internal/utils/ui.py1
-rw-r--r--src/pip/_internal/utils/unpacking.py1
-rw-r--r--src/pip/_internal/vcs/bazaar.py3
-rw-r--r--src/pip/_internal/vcs/git.py3
-rw-r--r--src/pip/_internal/vcs/mercurial.py3
-rw-r--r--src/pip/_internal/vcs/subversion.py3
-rw-r--r--src/pip/_internal/vcs/versioncontrol.py4
-rw-r--r--src/pip/_internal/wheel.py1
-rw-r--r--tools/automation/vendoring/__init__.py3
-rw-r--r--tools/tox_pip.py3
68 files changed, 177 insertions, 0 deletions
diff --git a/noxfile.py b/noxfile.py
index 7b19ee959..2702fd306 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -1,6 +1,9 @@
"""Automation using nox.
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import io
import os
import shutil
diff --git a/setup.cfg b/setup.cfg
index 81396f9ba..05e24a237 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,6 +29,7 @@ ignore = W504
[mypy]
follow_imports = silent
ignore_missing_imports = True
+disallow_untyped_defs = True
[mypy-pip/_vendor/*]
follow_imports = skip
diff --git a/setup.py b/setup.py
index b05c1b877..db4c55eeb 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import codecs
import os
import re
diff --git a/src/pip/_internal/build_env.py b/src/pip/_internal/build_env.py
index f1d9b378b..e91f71af7 100644
--- a/src/pip/_internal/build_env.py
+++ b/src/pip/_internal/build_env.py
@@ -3,6 +3,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import logging
import os
diff --git a/src/pip/_internal/cli/autocompletion.py b/src/pip/_internal/cli/autocompletion.py
index 287e62c78..5440241b3 100644
--- a/src/pip/_internal/cli/autocompletion.py
+++ b/src/pip/_internal/cli/autocompletion.py
@@ -1,6 +1,9 @@
"""Logic that powers autocompletion installed by ``pip completion``.
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import optparse
import os
import sys
diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py
index d8a6ebd54..ffed050f8 100644
--- a/src/pip/_internal/cli/cmdoptions.py
+++ b/src/pip/_internal/cli/cmdoptions.py
@@ -9,6 +9,7 @@ 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
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/cli/command_context.py b/src/pip/_internal/cli/command_context.py
index c55f0116e..3ab255f55 100644
--- a/src/pip/_internal/cli/command_context.py
+++ b/src/pip/_internal/cli/command_context.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from contextlib import contextmanager
from pip._vendor.contextlib2 import ExitStack
diff --git a/src/pip/_internal/cli/parser.py b/src/pip/_internal/cli/parser.py
index e1eaac420..c99456bae 100644
--- a/src/pip/_internal/cli/parser.py
+++ b/src/pip/_internal/cli/parser.py
@@ -1,4 +1,8 @@
"""Base option parser setup"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/cli/req_command.py b/src/pip/_internal/cli/req_command.py
index 01f67012d..4bfbbc83c 100644
--- a/src/pip/_internal/cli/req_command.py
+++ b/src/pip/_internal/cli/req_command.py
@@ -5,6 +5,9 @@ needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os
from functools import partial
diff --git a/src/pip/_internal/collector.py b/src/pip/_internal/collector.py
index 5b3c88eb5..e6ee598e8 100644
--- a/src/pip/_internal/collector.py
+++ b/src/pip/_internal/collector.py
@@ -2,6 +2,9 @@
The main purpose of this module is to expose LinkCollector.collect_links().
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import cgi
import itertools
import logging
diff --git a/src/pip/_internal/commands/__init__.py b/src/pip/_internal/commands/__init__.py
index 11d2a14c6..2a311f8fc 100644
--- a/src/pip/_internal/commands/__init__.py
+++ b/src/pip/_internal/commands/__init__.py
@@ -1,6 +1,10 @@
"""
Package containing all pip commands
"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import importlib
diff --git a/src/pip/_internal/commands/check.py b/src/pip/_internal/commands/check.py
index c9c3e30f3..968944611 100644
--- a/src/pip/_internal/commands/check.py
+++ b/src/pip/_internal/commands/check.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import logging
from pip._internal.cli.base_command import Command
diff --git a/src/pip/_internal/commands/completion.py b/src/pip/_internal/commands/completion.py
index f8975a439..c532806e3 100644
--- a/src/pip/_internal/commands/completion.py
+++ b/src/pip/_internal/commands/completion.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import sys
diff --git a/src/pip/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py
index 6c3a07295..9b6eb1602 100644
--- a/src/pip/_internal/commands/configuration.py
+++ b/src/pip/_internal/commands/configuration.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import logging
import os
import subprocess
diff --git a/src/pip/_internal/commands/debug.py b/src/pip/_internal/commands/debug.py
index df31c83bf..5322c828b 100644
--- a/src/pip/_internal/commands/debug.py
+++ b/src/pip/_internal/commands/debug.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import locale
diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py
index 4712a894d..a63019fbf 100644
--- a/src/pip/_internal/commands/download.py
+++ b/src/pip/_internal/commands/download.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/commands/freeze.py b/src/pip/_internal/commands/freeze.py
index 112a38043..c59eb3960 100644
--- a/src/pip/_internal/commands/freeze.py
+++ b/src/pip/_internal/commands/freeze.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import sys
diff --git a/src/pip/_internal/commands/hash.py b/src/pip/_internal/commands/hash.py
index f81946489..1dc7fb0ea 100644
--- a/src/pip/_internal/commands/hash.py
+++ b/src/pip/_internal/commands/hash.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import hashlib
diff --git a/src/pip/_internal/commands/help.py b/src/pip/_internal/commands/help.py
index 270e82b28..75af999b4 100644
--- a/src/pip/_internal/commands/help.py
+++ b/src/pip/_internal/commands/help.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
from pip._internal.cli.base_command import Command
diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py
index dc8bc3b8b..85c06093a 100644
--- a/src/pip/_internal/commands/install.py
+++ b/src/pip/_internal/commands/install.py
@@ -4,6 +4,7 @@
# couple errors where we have to know req.name is str rather than
# Optional[str] for the InstallRequirement req.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/commands/list.py b/src/pip/_internal/commands/list.py
index d6e38db86..08b621ff9 100644
--- a/src/pip/_internal/commands/list.py
+++ b/src/pip/_internal/commands/list.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import json
diff --git a/src/pip/_internal/commands/search.py b/src/pip/_internal/commands/search.py
index 9ae1fb533..2e880eec2 100644
--- a/src/pip/_internal/commands/search.py
+++ b/src/pip/_internal/commands/search.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/commands/show.py b/src/pip/_internal/commands/show.py
index 3baf785bd..a46b08eeb 100644
--- a/src/pip/_internal/commands/show.py
+++ b/src/pip/_internal/commands/show.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/commands/uninstall.py b/src/pip/_internal/commands/uninstall.py
index 0d8e4662f..1bde414a6 100644
--- a/src/pip/_internal/commands/uninstall.py
+++ b/src/pip/_internal/commands/uninstall.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
from pip._vendor.packaging.utils import canonicalize_name
diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py
index b95732b0c..7230470b7 100644
--- a/src/pip/_internal/commands/wheel.py
+++ b/src/pip/_internal/commands/wheel.py
@@ -1,4 +1,8 @@
# -*- coding: utf-8 -*-
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/configuration.py b/src/pip/_internal/configuration.py
index 684355785..858c66029 100644
--- a/src/pip/_internal/configuration.py
+++ b/src/pip/_internal/configuration.py
@@ -13,6 +13,7 @@ Some terminology:
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import locale
import logging
diff --git a/src/pip/_internal/distributions/base.py b/src/pip/_internal/distributions/base.py
index b9af3f025..929bbefb8 100644
--- a/src/pip/_internal/distributions/base.py
+++ b/src/pip/_internal/distributions/base.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import abc
from pip._vendor.six import add_metaclass
diff --git a/src/pip/_internal/distributions/installed.py b/src/pip/_internal/distributions/installed.py
index c4a64e7ca..454fb48c2 100644
--- a/src/pip/_internal/distributions/installed.py
+++ b/src/pip/_internal/distributions/installed.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from pip._internal.distributions.base import AbstractDistribution
diff --git a/src/pip/_internal/distributions/source/legacy.py b/src/pip/_internal/distributions/source/legacy.py
index 8005b1fc0..ae1d9b40b 100644
--- a/src/pip/_internal/distributions/source/legacy.py
+++ b/src/pip/_internal/distributions/source/legacy.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import logging
from pip._internal.build_env import BuildEnvironment
diff --git a/src/pip/_internal/distributions/wheel.py b/src/pip/_internal/distributions/wheel.py
index de7be38ee..128951ff6 100644
--- a/src/pip/_internal/distributions/wheel.py
+++ b/src/pip/_internal/distributions/wheel.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from pip._vendor import pkg_resources
from pip._internal.distributions.base import AbstractDistribution
diff --git a/src/pip/_internal/download.py b/src/pip/_internal/download.py
index d3415c5b3..6567fc375 100644
--- a/src/pip/_internal/download.py
+++ b/src/pip/_internal/download.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import cgi
diff --git a/src/pip/_internal/exceptions.py b/src/pip/_internal/exceptions.py
index 78483d7d5..dddec789e 100644
--- a/src/pip/_internal/exceptions.py
+++ b/src/pip/_internal/exceptions.py
@@ -1,4 +1,8 @@
"""Exceptions used throughout package"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
from itertools import chain, groupby, repeat
diff --git a/src/pip/_internal/index.py b/src/pip/_internal/index.py
index 81bdd4ad5..897444aae 100644
--- a/src/pip/_internal/index.py
+++ b/src/pip/_internal/index.py
@@ -2,6 +2,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/legacy_resolve.py b/src/pip/_internal/legacy_resolve.py
index 84855d73a..c24158f4d 100644
--- a/src/pip/_internal/legacy_resolve.py
+++ b/src/pip/_internal/legacy_resolve.py
@@ -12,6 +12,7 @@ for sub-dependencies
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import logging
import sys
diff --git a/src/pip/_internal/locations.py b/src/pip/_internal/locations.py
index e7e8057c6..1899c7d03 100644
--- a/src/pip/_internal/locations.py
+++ b/src/pip/_internal/locations.py
@@ -2,6 +2,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/main.py b/src/pip/_internal/main.py
index 9b55d0f02..1e922402a 100644
--- a/src/pip/_internal/main.py
+++ b/src/pip/_internal/main.py
@@ -1,5 +1,8 @@
"""Primary application entrypoint.
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import locale
diff --git a/src/pip/_internal/models/candidate.py b/src/pip/_internal/models/candidate.py
index 1b99690f2..4d49604dd 100644
--- a/src/pip/_internal/models/candidate.py
+++ b/src/pip/_internal/models/candidate.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from pip._vendor.packaging.version import parse as parse_version
from pip._internal.utils.models import KeyBasedCompareMixin
diff --git a/src/pip/_internal/models/format_control.py b/src/pip/_internal/models/format_control.py
index e1d36e4ee..5489b51d0 100644
--- a/src/pip/_internal/models/format_control.py
+++ b/src/pip/_internal/models/format_control.py
@@ -1,5 +1,6 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from pip._vendor.packaging.utils import canonicalize_name
diff --git a/src/pip/_internal/models/link.py b/src/pip/_internal/models/link.py
index 416b44459..2d50d1798 100644
--- a/src/pip/_internal/models/link.py
+++ b/src/pip/_internal/models/link.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os
import posixpath
import re
diff --git a/src/pip/_internal/models/search_scope.py b/src/pip/_internal/models/search_scope.py
index 5d667deef..6e387068b 100644
--- a/src/pip/_internal/models/search_scope.py
+++ b/src/pip/_internal/models/search_scope.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import itertools
import logging
import os
diff --git a/src/pip/_internal/network/auth.py b/src/pip/_internal/network/auth.py
index cce79a521..1e1da54ca 100644
--- a/src/pip/_internal/network/auth.py
+++ b/src/pip/_internal/network/auth.py
@@ -4,6 +4,9 @@ Contains interface (MultiDomainBasicAuth) and associated glue code for
providing credentials in the context of network requests.
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import logging
from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth
diff --git a/src/pip/_internal/network/cache.py b/src/pip/_internal/network/cache.py
index 9cd640300..d23c0ffaf 100644
--- a/src/pip/_internal/network/cache.py
+++ b/src/pip/_internal/network/cache.py
@@ -1,5 +1,9 @@
"""HTTP cache implementation.
"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os
from contextlib import contextmanager
diff --git a/src/pip/_internal/network/session.py b/src/pip/_internal/network/session.py
index 0e9f44f56..52e324ad8 100644
--- a/src/pip/_internal/network/session.py
+++ b/src/pip/_internal/network/session.py
@@ -1,6 +1,10 @@
"""PipSession and supporting code, containing all pip-specific
network request configuration and behavior.
"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import email.utils
import json
import logging
diff --git a/src/pip/_internal/operations/check.py b/src/pip/_internal/operations/check.py
index 9f7fe6a7f..6bd18841a 100644
--- a/src/pip/_internal/operations/check.py
+++ b/src/pip/_internal/operations/check.py
@@ -3,6 +3,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import logging
from collections import namedtuple
diff --git a/src/pip/_internal/operations/freeze.py b/src/pip/_internal/operations/freeze.py
index 6eaa85b19..bfdddf979 100644
--- a/src/pip/_internal/operations/freeze.py
+++ b/src/pip/_internal/operations/freeze.py
@@ -1,5 +1,6 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py
index 18ae249ee..d0930458d 100644
--- a/src/pip/_internal/operations/prepare.py
+++ b/src/pip/_internal/operations/prepare.py
@@ -3,6 +3,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import logging
import os
diff --git a/src/pip/_internal/req/constructors.py b/src/pip/_internal/req/constructors.py
index acb353e81..03b51484b 100644
--- a/src/pip/_internal/req/constructors.py
+++ b/src/pip/_internal/req/constructors.py
@@ -10,6 +10,7 @@ InstallRequirement.
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
import logging
import os
diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py
index f6fd29d3b..612e41f74 100644
--- a/src/pip/_internal/req/req_install.py
+++ b/src/pip/_internal/req/req_install.py
@@ -1,5 +1,6 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/utils/appdirs.py b/src/pip/_internal/utils/appdirs.py
index 14e45b197..06cd8314a 100644
--- a/src/pip/_internal/utils/appdirs.py
+++ b/src/pip/_internal/utils/appdirs.py
@@ -2,6 +2,10 @@
This code was taken from https://github.com/ActiveState/appdirs and modified
to suit our purposes.
"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import os
diff --git a/src/pip/_internal/utils/compat.py b/src/pip/_internal/utils/compat.py
index ebaae3bd5..dbd844875 100644
--- a/src/pip/_internal/utils/compat.py
+++ b/src/pip/_internal/utils/compat.py
@@ -1,5 +1,9 @@
"""Stuff that differs in different Python versions and platform
distributions."""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import, division
import codecs
diff --git a/src/pip/_internal/utils/deprecation.py b/src/pip/_internal/utils/deprecation.py
index b9359bddc..2f20cfd49 100644
--- a/src/pip/_internal/utils/deprecation.py
+++ b/src/pip/_internal/utils/deprecation.py
@@ -1,6 +1,10 @@
"""
A module that implements tooling to enable easy warnings about deprecations.
"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/utils/hashes.py b/src/pip/_internal/utils/hashes.py
index 4f075b091..a0d87a41e 100644
--- a/src/pip/_internal/utils/hashes.py
+++ b/src/pip/_internal/utils/hashes.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import hashlib
diff --git a/src/pip/_internal/utils/logging.py b/src/pip/_internal/utils/logging.py
index 3fbec7127..dd5ff9cd0 100644
--- a/src/pip/_internal/utils/logging.py
+++ b/src/pip/_internal/utils/logging.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import contextlib
diff --git a/src/pip/_internal/utils/marker_files.py b/src/pip/_internal/utils/marker_files.py
index c0396951f..734cba4c1 100644
--- a/src/pip/_internal/utils/marker_files.py
+++ b/src/pip/_internal/utils/marker_files.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os.path
DELETE_MARKER_MESSAGE = '''\
diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py
index 5b66a9c6d..42e913cd8 100644
--- a/src/pip/_internal/utils/misc.py
+++ b/src/pip/_internal/utils/misc.py
@@ -1,5 +1,6 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/utils/models.py b/src/pip/_internal/utils/models.py
index fccaf5ddc..29e144115 100644
--- a/src/pip/_internal/utils/models.py
+++ b/src/pip/_internal/utils/models.py
@@ -1,5 +1,7 @@
"""Utilities for defining models
"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
import operator
diff --git a/src/pip/_internal/utils/outdated.py b/src/pip/_internal/utils/outdated.py
index 42e272793..3275dd062 100644
--- a/src/pip/_internal/utils/outdated.py
+++ b/src/pip/_internal/utils/outdated.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import datetime
diff --git a/src/pip/_internal/utils/temp_dir.py b/src/pip/_internal/utils/temp_dir.py
index 87e0becae..77d40be6d 100644
--- a/src/pip/_internal/utils/temp_dir.py
+++ b/src/pip/_internal/utils/temp_dir.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import errno
diff --git a/src/pip/_internal/utils/ui.py b/src/pip/_internal/utils/ui.py
index 80cdab379..f96ab54d0 100644
--- a/src/pip/_internal/utils/ui.py
+++ b/src/pip/_internal/utils/ui.py
@@ -1,5 +1,6 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import, division
diff --git a/src/pip/_internal/utils/unpacking.py b/src/pip/_internal/utils/unpacking.py
index 81a368f27..7252dc217 100644
--- a/src/pip/_internal/utils/unpacking.py
+++ b/src/pip/_internal/utils/unpacking.py
@@ -3,6 +3,7 @@
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/src/pip/_internal/vcs/bazaar.py b/src/pip/_internal/vcs/bazaar.py
index 325b378ec..dc5322949 100644
--- a/src/pip/_internal/vcs/bazaar.py
+++ b/src/pip/_internal/vcs/bazaar.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/vcs/git.py b/src/pip/_internal/vcs/git.py
index 65069af7b..c571405d4 100644
--- a/src/pip/_internal/vcs/git.py
+++ b/src/pip/_internal/vcs/git.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py
index 4732d3863..96298e2a0 100644
--- a/src/pip/_internal/vcs/mercurial.py
+++ b/src/pip/_internal/vcs/mercurial.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/vcs/subversion.py b/src/pip/_internal/vcs/subversion.py
index 2d9ed9a10..7f6fca3ee 100644
--- a/src/pip/_internal/vcs/subversion.py
+++ b/src/pip/_internal/vcs/subversion.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import logging
diff --git a/src/pip/_internal/vcs/versioncontrol.py b/src/pip/_internal/vcs/versioncontrol.py
index 27610602f..d405d27da 100644
--- a/src/pip/_internal/vcs/versioncontrol.py
+++ b/src/pip/_internal/vcs/versioncontrol.py
@@ -1,4 +1,8 @@
"""Handles all VCS (version control) support"""
+
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
from __future__ import absolute_import
import errno
diff --git a/src/pip/_internal/wheel.py b/src/pip/_internal/wheel.py
index 02bc3f5f0..3d3af86a5 100644
--- a/src/pip/_internal/wheel.py
+++ b/src/pip/_internal/wheel.py
@@ -4,6 +4,7 @@ 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
+# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
diff --git a/tools/automation/vendoring/__init__.py b/tools/automation/vendoring/__init__.py
index 3f0278838..ca6aee8e7 100644
--- a/tools/automation/vendoring/__init__.py
+++ b/tools/automation/vendoring/__init__.py
@@ -1,5 +1,8 @@
""""Vendoring script, python 3.5 with requests needed"""
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os
import re
import shutil
diff --git a/tools/tox_pip.py b/tools/tox_pip.py
index 8d91fbf56..5996dade6 100644
--- a/tools/tox_pip.py
+++ b/tools/tox_pip.py
@@ -1,3 +1,6 @@
+# The following comment should be removed at some point in the future.
+# mypy: disallow-untyped-defs=False
+
import os
import shutil
import subprocess