Skip to content

Commit 4c8af23

Browse files
correctmostDanielNoord
authored andcommitted
Expand mypy CI checks to three more files
1 parent 2d26795 commit 4c8af23

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

astroid/brain/brain_mechanize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE
33
# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt
44

5+
from astroid import nodes
56
from astroid.brain.helpers import register_module_extender
67
from astroid.builder import AstroidBuilder
78
from astroid.manager import AstroidManager
89

910

10-
def mechanize_transform():
11+
def mechanize_transform() -> nodes.Module:
1112
return AstroidBuilder(AstroidManager()).string_build(
1213
"""class Browser(object):
1314
def __getattr__(self, name):

astroid/context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
if TYPE_CHECKING:
1717
from astroid import constraint, nodes
18-
from astroid.nodes.node_classes import Keyword, NodeNG
18+
from astroid.nodes.node_classes import Keyword
19+
from astroid.nodes.node_ng import NodeNG
1920

2021
_InferenceCache = dict[
2122
tuple["NodeNG", Optional[str], Optional[str], Optional[str]], Sequence["NodeNG"]

astroid/modutils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _get_relative_base_path(filename: str, path_to_check: str) -> list[str] | No
272272

273273
def modpath_from_file_with_callback(
274274
filename: str,
275-
path: Sequence[str] | None = None,
275+
path: list[str] | None = None,
276276
is_package_cb: Callable[[str, list[str]], bool] | None = None,
277277
) -> list[str]:
278278
filename = os.path.expanduser(_path_from_filename(filename))
@@ -298,7 +298,7 @@ def modpath_from_file_with_callback(
298298
)
299299

300300

301-
def modpath_from_file(filename: str, path: Sequence[str] | None = None) -> list[str]:
301+
def modpath_from_file(filename: str, path: list[str] | None = None) -> list[str]:
302302
"""Get the corresponding split module's name from a filename.
303303
304304
This function will return the name of a module or package split on `.`.
@@ -607,7 +607,7 @@ def is_relative(modname: str, from_file: str) -> bool:
607607

608608

609609
@lru_cache(maxsize=1024)
610-
def cached_os_path_isfile(path: str | os.PathLike) -> bool:
610+
def cached_os_path_isfile(path: str | os.PathLike[str]) -> bool:
611611
"""A cached version of os.path.isfile that helps avoid repetitive I/O"""
612612
return os.path.isfile(path)
613613

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ files = [
7575
"astroid/brain/brain_hashlib.py",
7676
"astroid/brain/brain_http.py",
7777
"astroid/brain/brain_hypothesis.py",
78+
"astroid/brain/brain_mechanize.py",
7879
"astroid/brain/brain_numpy_core_einsumfunc.py",
7980
"astroid/brain/brain_numpy_core_fromnumeric.py",
8081
"astroid/brain/brain_numpy_core_function_base.py",
@@ -95,7 +96,9 @@ files = [
9596
"astroid/brain/brain_unittest.py",
9697
"astroid/brain/brain_uuid.py",
9798
"astroid/const.py",
99+
"astroid/context.py",
98100
"astroid/interpreter/_import/",
101+
"astroid/modutils.py",
99102
"astroid/nodes/const.py",
100103
"astroid/nodes/utils.py",
101104
]

0 commit comments

Comments
 (0)