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