add per-file disallow_untyped_defs=False, and set it to True globally

This commit is contained in:
Maxim Kurnikov 2019-09-28 21:12:49 +03:00 committed by Xavier Fernandez
parent 8652923365
commit 3692097cca
68 changed files with 177 additions and 0 deletions

View File

@ -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

View File

@ -29,6 +29,7 @@ ignore = W504
[mypy]
follow_imports = silent
ignore_missing_imports = True
disallow_untyped_defs = True
[mypy-pip/_vendor/*]
follow_imports = skip

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 = '''\

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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