From 79b0e159730bda6cae8e1c68e3a0fd0d851a87d0 Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Sat, 28 Sep 2019 21:12:49 +0300 Subject: [PATCH] add per-file disallow_untyped_defs=False, and set it to True globally --- noxfile.py | 3 +++ setup.cfg | 1 + setup.py | 3 +++ src/pip/_internal/build_env.py | 1 + src/pip/_internal/cli/autocompletion.py | 3 +++ src/pip/_internal/cli/cmdoptions.py | 1 + src/pip/_internal/cli/command_context.py | 3 +++ src/pip/_internal/cli/parser.py | 4 ++++ src/pip/_internal/cli/req_command.py | 3 +++ src/pip/_internal/collector.py | 3 +++ src/pip/_internal/commands/__init__.py | 4 ++++ src/pip/_internal/commands/check.py | 3 +++ src/pip/_internal/commands/completion.py | 3 +++ src/pip/_internal/commands/configuration.py | 3 +++ src/pip/_internal/commands/debug.py | 3 +++ src/pip/_internal/commands/download.py | 3 +++ src/pip/_internal/commands/freeze.py | 3 +++ src/pip/_internal/commands/hash.py | 3 +++ src/pip/_internal/commands/help.py | 3 +++ src/pip/_internal/commands/install.py | 1 + src/pip/_internal/commands/list.py | 3 +++ src/pip/_internal/commands/search.py | 3 +++ src/pip/_internal/commands/show.py | 3 +++ src/pip/_internal/commands/uninstall.py | 3 +++ src/pip/_internal/commands/wheel.py | 4 ++++ src/pip/_internal/configuration.py | 1 + src/pip/_internal/distributions/base.py | 3 +++ src/pip/_internal/distributions/installed.py | 3 +++ src/pip/_internal/distributions/source/legacy.py | 3 +++ src/pip/_internal/distributions/wheel.py | 3 +++ src/pip/_internal/download.py | 3 +++ src/pip/_internal/exceptions.py | 4 ++++ src/pip/_internal/index.py | 1 + src/pip/_internal/legacy_resolve.py | 1 + src/pip/_internal/locations.py | 1 + src/pip/_internal/main.py | 3 +++ src/pip/_internal/models/candidate.py | 3 +++ src/pip/_internal/models/format_control.py | 1 + src/pip/_internal/models/link.py | 3 +++ src/pip/_internal/models/search_scope.py | 3 +++ src/pip/_internal/network/auth.py | 3 +++ src/pip/_internal/network/cache.py | 4 ++++ src/pip/_internal/network/session.py | 4 ++++ src/pip/_internal/operations/check.py | 1 + src/pip/_internal/operations/freeze.py | 1 + src/pip/_internal/operations/prepare.py | 1 + src/pip/_internal/req/constructors.py | 1 + src/pip/_internal/req/req_install.py | 1 + src/pip/_internal/utils/appdirs.py | 4 ++++ src/pip/_internal/utils/compat.py | 4 ++++ src/pip/_internal/utils/deprecation.py | 4 ++++ src/pip/_internal/utils/hashes.py | 3 +++ src/pip/_internal/utils/logging.py | 3 +++ src/pip/_internal/utils/marker_files.py | 3 +++ src/pip/_internal/utils/misc.py | 1 + src/pip/_internal/utils/models.py | 2 ++ src/pip/_internal/utils/outdated.py | 3 +++ src/pip/_internal/utils/temp_dir.py | 3 +++ src/pip/_internal/utils/ui.py | 1 + src/pip/_internal/utils/unpacking.py | 1 + src/pip/_internal/vcs/bazaar.py | 3 +++ src/pip/_internal/vcs/git.py | 3 +++ src/pip/_internal/vcs/mercurial.py | 3 +++ src/pip/_internal/vcs/subversion.py | 3 +++ src/pip/_internal/vcs/versioncontrol.py | 4 ++++ src/pip/_internal/wheel.py | 1 + tools/automation/vendoring/__init__.py | 3 +++ tools/tox_pip.py | 3 +++ 68 files changed, 177 insertions(+) diff --git a/noxfile.py b/noxfile.py index d6357b3dd7d..d682680aec0 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,9 @@ """Release time helpers, executed using nox. """ +# The following comment should be removed at some point in the future. +# mypy: disallow-untyped-defs=False + import io import subprocess diff --git a/setup.cfg b/setup.cfg index 81396f9ba3e..05e24a23741 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 b05c1b8779b..db4c55eeb6a 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 f1d9b378b24..e91f71af755 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 287e62c78a5..5440241b342 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 d8a6ebd54b6..ffed050f875 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -9,6 +9,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/cli/command_context.py b/src/pip/_internal/cli/command_context.py index c55f0116e19..3ab255f558f 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 e1eaac42042..c99456bae88 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 01f67012dcd..4bfbbc83cd9 100644 --- a/src/pip/_internal/cli/req_command.py +++ b/src/pip/_internal/cli/req_command.py @@ -5,6 +5,9 @@ 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 5b3c88eb5ac..e6ee598e806 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 11d2a14c61d..2a311f8fc89 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 c9c3e30f3a8..968944611ea 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 f8975a4398d..c532806e386 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 6c3a0729523..9b6eb1602da 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 df31c83bf51..5322c828bde 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 4712a894d8a..a63019fbf50 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 112a380439d..c59eb3960a6 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 f8194648940..1dc7fb0eac9 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 270e82b28c6..75af999b41e 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 dc8bc3b8bdb..85c06093ac2 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 d6e38db8659..08b621ff9ae 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 ef698d0b7ec..7f6c0d8ec04 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 3baf785bd22..a46b08eeb3d 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 0d8e4662f09..1bde414a6c1 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 b95732b0ce4..7230470b7d7 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 6843557855f..858c6602946 100644 --- a/src/pip/_internal/configuration.py +++ b/src/pip/_internal/configuration.py @@ -13,6 +13,7 @@ # 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 b9af3f025a0..929bbefb858 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 c4a64e7ca55..454fb48c2b4 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 8005b1fc00a..ae1d9b40b68 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 de7be38ee8f..128951ff6d1 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 53d53458619..093a3b78673 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 78483d7d565..dddec789ef4 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 81bdd4ad546..897444aae3f 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 84855d73a39..c24158f4d37 100644 --- a/src/pip/_internal/legacy_resolve.py +++ b/src/pip/_internal/legacy_resolve.py @@ -12,6 +12,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 sys diff --git a/src/pip/_internal/locations.py b/src/pip/_internal/locations.py index e7e8057c6ee..1899c7d03c4 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 9b55d0f02de..1e922402a0b 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 1b99690f22c..4d49604ddfc 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 e1d36e4ee29..5489b51d076 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 416b4445973..2d50d17989f 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 5d667deef59..6e387068b63 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 cce79a521d2..1e1da54ca59 100644 --- a/src/pip/_internal/network/auth.py +++ b/src/pip/_internal/network/auth.py @@ -4,6 +4,9 @@ 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 9cd6403003e..d23c0ffaf5a 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 0e9f44f562d..52e324ad8dc 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 9f7fe6a7f61..6bd18841a20 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 6eaa85b19ec..bfdddf97952 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 18ae249ee1c..d0930458d11 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 acb353e816a..03b51484b16 100644 --- a/src/pip/_internal/req/constructors.py +++ b/src/pip/_internal/req/constructors.py @@ -10,6 +10,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/req_install.py b/src/pip/_internal/req/req_install.py index f6fd29d3bad..612e41f7416 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 dcd757c7e05..2bde0724a26 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 ebaae3bd597..dbd84487559 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 b9359bddc5f..2f20cfd49d3 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 4f075b0918c..a0d87a41ea3 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 3fbec712709..dd5ff9cd080 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 c0396951f94..734cba4c1d4 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 5b66a9c6dbe..42e913cd893 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 fccaf5ddce7..29e1441153b 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 42e27279382..3275dd062ee 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 87e0becaee3..77d40be6da3 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 80cdab37912..f96ab54d01a 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 81a368f27ce..7252dc217bf 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 325b378ecd2..dc532294948 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 65069af7b7b..c571405d471 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 4732d3863eb..96298e2a0f3 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 2d9ed9a100d..7f6fca3ee8c 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 27610602f16..d405d27da6f 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 8d3c7aefdce..d40eceac076 100644 --- a/src/pip/_internal/wheel.py +++ b/src/pip/_internal/wheel.py @@ -4,6 +4,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/tools/automation/vendoring/__init__.py b/tools/automation/vendoring/__init__.py index 3f0278838d2..ca6aee8e71c 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 8d91fbf56b0..5996dade6d2 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