1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
import sys
from _typeshed import StrPath
from py_compile import PycInvalidationMode
from typing import Any, Protocol
__all__ = ["compile_dir", "compile_file", "compile_path"]
class _SupportsSearch(Protocol):
def search(self, string: str, /) -> Any: ...
if sys.version_info >= (3, 10):
def compile_dir(
dir: StrPath,
maxlevels: int | None = None,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
workers: int = 1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: StrPath | None = None,
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
def compile_file(
fullname: StrPath,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: StrPath | None = None,
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
elif sys.version_info >= (3, 9):
def compile_dir(
dir: StrPath,
maxlevels: int | None = None,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
workers: int = 1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: str | None = None, # https://bugs.python.org/issue40447
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
def compile_file(
fullname: StrPath,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
*,
stripdir: str | None = None, # https://bugs.python.org/issue40447
prependdir: StrPath | None = None,
limit_sl_dest: StrPath | None = None,
hardlink_dupes: bool = False,
) -> int: ...
else:
def compile_dir(
dir: StrPath,
maxlevels: int = 10,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
workers: int = 1,
invalidation_mode: PycInvalidationMode | None = None,
) -> int: ...
def compile_file(
fullname: StrPath,
ddir: StrPath | None = None,
force: bool = False,
rx: _SupportsSearch | None = None,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
) -> int: ...
def compile_path(
skip_curdir: bool = ...,
maxlevels: int = 0,
force: bool = False,
quiet: int = 0,
legacy: bool = False,
optimize: int = -1,
invalidation_mode: PycInvalidationMode | None = None,
) -> int: ...
|