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
Pradyun Gedam 428e886ad6
Drop out-of-tree/in-tree build transition flags
These were intended to help users transition when the default behaviour
changed to no longer perform out-of-tree builds. The transition is now
considered complete.
2022-04-08 12:20:36 +01:00

19 lines
619 B
Python

"""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),
)
return set(chain.from_iterable(join(*dirinfo) for dirinfo in os.walk(base)))