Skip to content

Commit 75c3a9c

Browse files
committed
Fix some lint issues
1 parent 6e47f02 commit 75c3a9c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

pip_check_reqs/common.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import ast
66
import fnmatch
7-
# import imp
87
import importlib
98
import logging
109
import os
@@ -80,7 +79,10 @@ def _add_module(self, modname: str, lineno: int) -> None:
8079
progress = []
8180
modpath = None
8281
for modname_part in modname.split("."):
83-
find_spec_result = importlib.util.find_spec(name=modname_part, package=path)
82+
find_spec_result = importlib.util.find_spec(
83+
name=modname_part,
84+
package=path,
85+
)
8486

8587
if find_spec_result is None:
8688
# The component specified at this point is not installed.
@@ -97,7 +99,10 @@ def _add_module(self, modname: str, lineno: int) -> None:
9799

98100
modname = ".".join(progress)
99101
if modname not in self._modules:
100-
self._modules[modname] = FoundModule(modname=modname, filename=Path(modpath).parent)
102+
self._modules[modname] = FoundModule(
103+
modname=modname,
104+
filename=str(Path(modpath).parent),
105+
)
101106
assert isinstance(self._location, str)
102107
self._modules[modname].locations.append((self._location, lineno))
103108

tests/test_common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ def test_pyfiles_package(tmp_path: Path) -> None:
106106
("ham.py", 2),
107107
],
108108
),
109-
(False, True, ["ast", "pathlib", "sys"], [("spam.py", 2), ("ham.py", 2)]),
109+
(
110+
False,
111+
True,
112+
["ast", "pathlib", "sys"],
113+
[("spam.py", 2), ("ham.py", 2)],
114+
),
110115
(True, False, ["ast", "sys"], [("spam.py", 2)]),
111116
(True, True, ["ast", "sys"], [("spam.py", 2)]),
112117
],

0 commit comments

Comments
 (0)