Skip to content

Commit

Permalink
Update compileall stripdir type
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Dec 23, 2022
1 parent 0220577 commit 1b59042
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions stdlib/compileall.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,42 @@ __all__ = ["compile_dir", "compile_file", "compile_path"]
class _SupportsSearch(Protocol):
def search(self, string: str) -> Any: ...

if sys.version_info >= (3, 9):

if sys.version_info >= (3, 10):
def compile_dir(
dir: StrPath,
maxlevels: int | None = ...,
ddir: StrPath | None = ...,
force: bool = ...,
rx: _SupportsSearch | None = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
workers: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
*,
stripdir: StrPath | None = ...,
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
) -> int: ...
def compile_file(
fullname: StrPath,
ddir: StrPath | None = ...,
force: bool = ...,
rx: _SupportsSearch | None = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
*,
stripdir: StrPath | None = ...,
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
) -> int: ...

elif sys.version_info >= (3, 9):
def compile_dir(
dir: StrPath,
maxlevels: int | None = ...,
Expand All @@ -21,7 +56,7 @@ if sys.version_info >= (3, 9):
workers: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
*,
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
stripdir: str | None = ..., # https://bugs.python.org/issue40447
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
Expand All @@ -36,7 +71,7 @@ if sys.version_info >= (3, 9):
optimize: int = ...,
invalidation_mode: PycInvalidationMode | None = ...,
*,
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
stripdir: str | None = ..., # https://bugs.python.org/issue40447
prependdir: StrPath | None = ...,
limit_sl_dest: StrPath | None = ...,
hardlink_dupes: bool = ...,
Expand Down

0 comments on commit 1b59042

Please sign in to comment.