1"""Filetype information.
4from typing
import Tuple
8WHEEL_EXTENSION =
".whl"
9BZ2_EXTENSIONS: Tuple[str, ...] = (
".tar.bz2",
".tbz")
10XZ_EXTENSIONS: Tuple[str, ...] = (
17ZIP_EXTENSIONS: Tuple[str, ...] = (
".zip", WHEEL_EXTENSION)
18TAR_EXTENSIONS: Tuple[str, ...] = (
".tar.gz",
".tgz",
".tar")
19ARCHIVE_EXTENSIONS = ZIP_EXTENSIONS + BZ2_EXTENSIONS + TAR_EXTENSIONS + XZ_EXTENSIONS
22def is_archive_file(name: str) -> bool:
23 """Return True if `name` is a considered as an archive file."""
24 ext = splitext(name)[1].
lower()
25 if ext
in ARCHIVE_EXTENSIONS: