git_archive_all.pyi 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. from os import PathLike as _PathLike
  2. import logging
  3. from typing import Callable, Collection, ClassVar, Dict, Generator, Iterable, List, Optional, Tuple, Union
  4. PathLike = Union[str, bytes, _PathLike]
  5. PathStr = Union[str, bytes]
  6. CheckGitAttrGen = Generator[Dict[str, bytes], PathStr, None]
  7. def fsdecode(filename: PathLike) -> str: ...
  8. def fsencode(filename: PathLike) -> bytes: ...
  9. def git_fsdecode(filename: bytes) -> str: ...
  10. def git_fsencode(filename: str) -> bytes: ...
  11. def fspath(filename: PathLike, decoder=Callable[[PathLike], str], encoder=Callable[[PathLike], bytes]) -> PathStr: ...
  12. def git_fspath(filename: bytes) -> PathStr: ...
  13. class GitArchiver(object):
  14. TARFILE_FORMATS: ClassVar[Dict[str, str]]
  15. ZIPFILE_FORMATS: ClassVar[Tuple[str]]
  16. LOG: ClassVar[logging.Logger]
  17. _check_attr_gens: Dict[str, CheckGitAttrGen]
  18. _ignored_paths_cache: Dict[PathStr, Dict[PathStr, bool]]
  19. git_version: Optional[Tuple[int]]
  20. main_repo_abspath: PathStr
  21. prefix: PathStr
  22. exclude: bool
  23. extra: List[PathStr]
  24. force_sub: bool
  25. def __init__(self,
  26. prefix: PathLike,
  27. exclude: bool,
  28. force_sub: bool,
  29. extra: Iterable[PathLike] = None,
  30. main_repo_abspath: PathLike = None,
  31. git_version: Tuple[int] = None) -> None: ...
  32. def create(self,
  33. output_path: PathLike,
  34. dry_run: bool,
  35. output_format: str = None,
  36. compresslevel: int = None) -> None: ...
  37. def is_file_excluded(self, repo_abspath: PathStr, repo_file_path: PathStr) -> bool: ...
  38. def archive_all_files(self, archiver: Callable[[PathStr, PathStr], None]) -> None: ...
  39. def walk_git_files(self, repo_path: PathStr = None) -> Generator[PathStr, None, None]: ...
  40. def check_git_attr(self, repo_abspath: PathStr, attrs: Collection[str]) -> CheckGitAttrGen: ...
  41. def resolve_git_main_repo_abspath(self, abspath: PathLike) -> PathStr: ...
  42. @classmethod
  43. def run_git_shell(cls, cmd: str, cwd: PathStr = None) -> bytes: ...
  44. @classmethod
  45. def get_git_version(cls) -> Optional[Tuple[int]]: ...
  46. @classmethod
  47. def list_repo_files(cls, repo_abspath: PathStr) -> Generator[PathStr, None, None]: ...
  48. @classmethod
  49. def list_repo_submodules(cls, repo_abspath: PathStr) -> Generator[PathStr, None, None]: ...