Skip to content

Commit e69f924

Browse files
committed
Get tests passing with 100% coverage removing imp module
1 parent d6d29ef commit e69f924

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# An empty string here represents the latest version.
2525
pip-version: ['==21.2.4', '']
2626
# The minimum version should be represented in setup.py.
27-
python-version: ["3.8", "3.9", "3.10", "3.11"]
27+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"]
2828

2929
steps:
3030
- uses: actions/checkout@v4

pip_check_reqs/common.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _add_module(self, modname: str, lineno: int) -> None:
7878
return
7979
path = None
8080
progress = []
81-
modpath = last_modpath = None
81+
modpath = None
8282
for modname_part in modname.split("."):
8383
find_spec_result = importlib.util.find_spec(name=modname_part, package=path)
8484

@@ -91,21 +91,6 @@ def _add_module(self, modname: str, lineno: int) -> None:
9191
# success! we found *something*
9292
progress.append(modname_part)
9393

94-
# we might have previously seen a useful path though...
95-
if modpath is None:
96-
# the `sys` module will hit this code path, and `os` will on
97-
# 3.11+.
98-
# Possibly others will, but I've not discovered them.
99-
modpath = last_modpath
100-
break
101-
102-
# ... though it might not be a file, so not interesting to us
103-
if not Path(modpath).is_dir():
104-
break
105-
106-
path = [modpath]
107-
last_modpath = modpath
108-
10994
if modpath is None:
11095
# the module doesn't actually appear to exist on disk
11196
return

0 commit comments

Comments
 (0)