Skip to content

Commit 3692097

Browse files
mkurnikovxavfernandez
authored andcommitted
add per-file disallow_untyped_defs=False, and set it to True globally
1 parent 8652923 commit 3692097

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+177
-0
lines changed

noxfile.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Automation using nox.
22
"""
33

4+
# The following comment should be removed at some point in the future.
5+
# mypy: disallow-untyped-defs=False
6+
47
import io
58
import os
69
import shutil

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ignore = W504
2929
[mypy]
3030
follow_imports = silent
3131
ignore_missing_imports = True
32+
disallow_untyped_defs = True
3233

3334
[mypy-pip/_vendor/*]
3435
follow_imports = skip

setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import codecs
25
import os
36
import re

src/pip/_internal/build_env.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# The following comment should be removed at some point in the future.
55
# mypy: strict-optional=False
6+
# mypy: disallow-untyped-defs=False
67

78
import logging
89
import os

src/pip/_internal/cli/autocompletion.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Logic that powers autocompletion installed by ``pip completion``.
22
"""
33

4+
# The following comment should be removed at some point in the future.
5+
# mypy: disallow-untyped-defs=False
6+
47
import optparse
58
import os
69
import sys

src/pip/_internal/cli/cmdoptions.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# The following comment should be removed at some point in the future.
1111
# mypy: strict-optional=False
12+
# mypy: disallow-untyped-defs=False
1213

1314
from __future__ import absolute_import
1415

src/pip/_internal/cli/command_context.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from contextlib import contextmanager
25

36
from pip._vendor.contextlib2 import ExitStack

src/pip/_internal/cli/parser.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""Base option parser setup"""
2+
3+
# The following comment should be removed at some point in the future.
4+
# mypy: disallow-untyped-defs=False
5+
26
from __future__ import absolute_import
37

48
import logging

src/pip/_internal/cli/req_command.py

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
PackageFinder machinery and all its vendored dependencies, etc.
66
"""
77

8+
# The following comment should be removed at some point in the future.
9+
# mypy: disallow-untyped-defs=False
10+
811
import os
912
from functools import partial
1013

src/pip/_internal/collector.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
The main purpose of this module is to expose LinkCollector.collect_links().
33
"""
44

5+
# The following comment should be removed at some point in the future.
6+
# mypy: disallow-untyped-defs=False
7+
58
import cgi
69
import itertools
710
import logging

src/pip/_internal/commands/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"""
22
Package containing all pip commands
33
"""
4+
5+
# The following comment should be removed at some point in the future.
6+
# mypy: disallow-untyped-defs=False
7+
48
from __future__ import absolute_import
59

610
import importlib

src/pip/_internal/commands/check.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import logging
25

36
from pip._internal.cli.base_command import Command

src/pip/_internal/commands/completion.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import sys

src/pip/_internal/commands/configuration.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import logging
25
import os
36
import subprocess

src/pip/_internal/commands/debug.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import locale

src/pip/_internal/commands/download.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import logging

src/pip/_internal/commands/freeze.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import sys

src/pip/_internal/commands/hash.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import hashlib

src/pip/_internal/commands/help.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
from pip._internal.cli.base_command import Command

src/pip/_internal/commands/install.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# couple errors where we have to know req.name is str rather than
55
# Optional[str] for the InstallRequirement req.
66
# mypy: strict-optional=False
7+
# mypy: disallow-untyped-defs=False
78

89
from __future__ import absolute_import
910

src/pip/_internal/commands/list.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import json

src/pip/_internal/commands/search.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import logging

src/pip/_internal/commands/show.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import logging

src/pip/_internal/commands/uninstall.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
from pip._vendor.packaging.utils import canonicalize_name

src/pip/_internal/commands/wheel.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# -*- coding: utf-8 -*-
2+
3+
# The following comment should be removed at some point in the future.
4+
# mypy: disallow-untyped-defs=False
5+
26
from __future__ import absolute_import
37

48
import logging

src/pip/_internal/configuration.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# The following comment should be removed at some point in the future.
1515
# mypy: strict-optional=False
16+
# mypy: disallow-untyped-defs=False
1617

1718
import locale
1819
import logging

src/pip/_internal/distributions/base.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import abc
25

36
from pip._vendor.six import add_metaclass

src/pip/_internal/distributions/installed.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from pip._internal.distributions.base import AbstractDistribution
25

36

src/pip/_internal/distributions/source/legacy.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import logging
25

36
from pip._internal.build_env import BuildEnvironment

src/pip/_internal/distributions/wheel.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from pip._vendor import pkg_resources
25

36
from pip._internal.distributions.base import AbstractDistribution

src/pip/_internal/download.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from __future__ import absolute_import
25

36
import cgi

src/pip/_internal/exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""Exceptions used throughout package"""
2+
3+
# The following comment should be removed at some point in the future.
4+
# mypy: disallow-untyped-defs=False
5+
26
from __future__ import absolute_import
37

48
from itertools import chain, groupby, repeat

src/pip/_internal/index.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# The following comment should be removed at some point in the future.
44
# mypy: strict-optional=False
5+
# mypy: disallow-untyped-defs=False
56

67
from __future__ import absolute_import
78

src/pip/_internal/legacy_resolve.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# The following comment should be removed at some point in the future.
1414
# mypy: strict-optional=False
15+
# mypy: disallow-untyped-defs=False
1516

1617
import logging
1718
import sys

src/pip/_internal/locations.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# The following comment should be removed at some point in the future.
44
# mypy: strict-optional=False
5+
# mypy: disallow-untyped-defs=False
56

67
from __future__ import absolute_import
78

src/pip/_internal/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""Primary application entrypoint.
22
"""
3+
# The following comment should be removed at some point in the future.
4+
# mypy: disallow-untyped-defs=False
5+
36
from __future__ import absolute_import
47

58
import locale

src/pip/_internal/models/candidate.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
from pip._vendor.packaging.version import parse as parse_version
25

36
from pip._internal.utils.models import KeyBasedCompareMixin

src/pip/_internal/models/format_control.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The following comment should be removed at some point in the future.
22
# mypy: strict-optional=False
3+
# mypy: disallow-untyped-defs=False
34

45
from pip._vendor.packaging.utils import canonicalize_name
56

src/pip/_internal/models/link.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import os
25
import posixpath
36
import re

src/pip/_internal/models/search_scope.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The following comment should be removed at some point in the future.
2+
# mypy: disallow-untyped-defs=False
3+
14
import itertools
25
import logging
36
import os

src/pip/_internal/network/auth.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
providing credentials in the context of network requests.
55
"""
66

7+
# The following comment should be removed at some point in the future.
8+
# mypy: disallow-untyped-defs=False
9+
710
import logging
811

912
from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth

src/pip/_internal/network/cache.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
"""HTTP cache implementation.
22
"""
3+
4+
# The following comment should be removed at some point in the future.
5+
# mypy: disallow-untyped-defs=False
6+
37
import os
48
from contextlib import contextmanager
59

src/pip/_internal/network/session.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
"""PipSession and supporting code, containing all pip-specific
22
network request configuration and behavior.
33
"""
4+
5+
# The following comment should be removed at some point in the future.
6+
# mypy: disallow-untyped-defs=False
7+
48
import email.utils
59
import json
610
import logging

src/pip/_internal/operations/check.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# The following comment should be removed at some point in the future.
55
# mypy: strict-optional=False
6+
# mypy: disallow-untyped-defs=False
67

78
import logging
89
from collections import namedtuple

src/pip/_internal/operations/freeze.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The following comment should be removed at some point in the future.
22
# mypy: strict-optional=False
3+
# mypy: disallow-untyped-defs=False
34

45
from __future__ import absolute_import
56

src/pip/_internal/operations/prepare.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# The following comment should be removed at some point in the future.
55
# mypy: strict-optional=False
6+
# mypy: disallow-untyped-defs=False
67

78
import logging
89
import os

src/pip/_internal/req/constructors.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# The following comment should be removed at some point in the future.
1212
# mypy: strict-optional=False
13+
# mypy: disallow-untyped-defs=False
1314

1415
import logging
1516
import os

src/pip/_internal/req/req_install.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# The following comment should be removed at some point in the future.
22
# mypy: strict-optional=False
3+
# mypy: disallow-untyped-defs=False
34

45
from __future__ import absolute_import
56

src/pip/_internal/utils/appdirs.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
This code was taken from https://github.com/ActiveState/appdirs and modified
33
to suit our purposes.
44
"""
5+
6+
# The following comment should be removed at some point in the future.
7+
# mypy: disallow-untyped-defs=False
8+
59
from __future__ import absolute_import
610

711
import os

0 commit comments

Comments
 (0)