Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
WangGithubUser committed Aug 21, 2023
1 parent 12d9935 commit de998fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions client/configuration/search_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
LOG: logging.Logger = logging.getLogger(__name__)

dist_info_in_root: Dict[str, List[str]] = {}
_site_filter = re.compile(r".*-([0-99]\.)*dist-info")
_site_filter: re.Pattern[str] = re.compile(r".*-([0-99]\.)*dist-info")

_PYCACHE = re.compile("__pycache__")
_PYCACHE: re.Pattern[str] = re.compile("__pycache__")


def _expand_relative_root(path: str, relative_root: str) -> str:
Expand Down Expand Up @@ -99,7 +99,10 @@ def package_path(self) -> Union[str, None]:
else:
return None

not_toplevel_patterns: Tuple[re.Pattern] = (this_pkg_filter, _PYCACHE)
not_toplevel_patterns: Tuple[re.Pattern[str], re.Pattern[str]] = (
this_pkg_filter,
_PYCACHE,
)

with open(file=f"{dist_info_path}/RECORD", mode="r") as record:
files = []
Expand Down
2 changes: 1 addition & 1 deletion client/configuration/tests/search_path_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_process_required_raw_elements_site_package_nonexistence(self) -> None:
required=True,
)

def test_toplevel_module_not_pyfile(self):
def test_toplevel_module_not_pyfile(self) -> None:
Path.mkdir(Path("foo"), exist_ok=True)
Path.mkdir(Path("foo/bar-1.0.0.dist-info"), exist_ok=True)
Path.touch(Path("foo/bar.so"), exist_ok=True)
Expand Down

0 comments on commit de998fd

Please sign in to comment.