1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/lib/filesystem.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
619 B
Python
Raw Normal View History

"""Helpers for filesystem-dependent tests.
"""
import os
from functools import partial
from itertools import chain
from typing import Iterator, List, Set
def get_filelist(base: str) -> Set[str]:
def join(dirpath: str, dirnames: List[str], filenames: List[str]) -> Iterator[str]:
relative_dirpath = os.path.relpath(dirpath, base)
join_dirpath = partial(os.path.join, relative_dirpath)
return chain(
(join_dirpath(p) for p in dirnames),
(join_dirpath(p) for p in filenames),
)
2021-04-02 11:21:40 +02:00
return set(chain.from_iterable(join(*dirinfo) for dirinfo in os.walk(base)))