Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileall: update for py39 #3956

Merged
merged 3 commits into from
May 28, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions stdlib/3/compileall.pyi
Original file line number Diff line number Diff line change
@@ -13,9 +13,11 @@ else:

if sys.version_info >= (3, 7):
from py_compile import PycInvalidationMode

if sys.version_info >= (3, 9):
def compile_dir(
dir: _Path,
maxlevels: int = ...,
maxlevels: Optional[int] = ...,
ddir: Optional[_Path] = ...,
force: bool = ...,
rx: Optional[Pattern[Any]] = ...,
@@ -24,6 +26,10 @@ if sys.version_info >= (3, 7):
optimize: int = ...,
workers: int = ...,
invalidation_mode: Optional[PycInvalidationMode] = ...,
*,
stripdir: Optional[_Path] = ...,
prependdir: Optional[_Path] = ...,
limit_sl_dest: Optional[_Path] = ...,
) -> _SuccessType: ...
def compile_file(
fullname: _Path,
@@ -34,11 +40,29 @@ if sys.version_info >= (3, 7):
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: Optional[PycInvalidationMode] = ...,
*,
stripdir: Optional[_Path] = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must actually be a string because it does stripdir.split(os.path.sep)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, contradicts the documentation. I filed https://bugs.python.org/issue40447

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the bug probably won't be fixed very soon, can you just change the stub for now?

prependdir: Optional[_Path] = ...,
limit_sl_dest: Optional[_Path] = ...,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But these two really can be PathLike

) -> _SuccessType: ...
def compile_path(
skip_curdir: bool = ...,
elif sys.version_info >= (3, 7):
def compile_dir(
dir: _Path,
maxlevels: int = ...,
ddir: Optional[_Path] = ...,
force: bool = ...,
rx: Optional[Pattern[Any]] = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
workers: int = ...,
invalidation_mode: Optional[PycInvalidationMode] = ...,
) -> _SuccessType: ...
def compile_file(
fullname: _Path,
ddir: Optional[_Path] = ...,
force: bool = ...,
rx: Optional[Pattern[Any]] = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
@@ -67,6 +91,18 @@ else:
legacy: bool = ...,
optimize: int = ...,
) -> _SuccessType: ...

if sys.version_info >= (3, 7):
def compile_path(
skip_curdir: bool = ...,
maxlevels: int = ...,
force: bool = ...,
quiet: int = ...,
legacy: bool = ...,
optimize: int = ...,
invalidation_mode: Optional[PycInvalidationMode] = ...,
) -> _SuccessType: ...
else:
def compile_path(
skip_curdir: bool = ...,
maxlevels: int = ...,