Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
filetypes.py
Go to the documentation of this file.
1"""Filetype information.
2"""
3
4from typing import Tuple
5
6from pip._internal.utils.misc import splitext
7
8WHEEL_EXTENSION = ".whl"
9BZ2_EXTENSIONS: Tuple[str, ...] = (".tar.bz2", ".tbz")
10XZ_EXTENSIONS: Tuple[str, ...] = (
11 ".tar.xz",
12 ".txz",
13 ".tlz",
14 ".tar.lz",
15 ".tar.lzma",
16)
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
20
21
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:
26 return True
27 return False
for i