-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
PyInstaller: Complete types in build_main.pyi #13528
base: main
Are you sure you want to change the base?
Conversation
Complete the incomplete types of Analysis class constructor params.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to add instance attributes to Analysis
class, not just __init__
params.
Add annotations for instance attributes.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
hookspath: list[tuple[StrPath, int]] | ||
excludes: list[str] | ||
custom_runtime_hooks: list[StrPath] | ||
module_collection_mode: dict[str, Literal["pyz", "pyc", "py", "pyz+py", "py+pyz"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have this as
module_collection_mode: dict[str, Literal["pyz", "pyc", "py", "pyz+py", "py+pyz"]] | |
module_collection_mode: dict[str, str] |
Literal
types are hard :)
cipher: _PyiBlockCipher = None, | ||
win_no_prefer_redirects: bool = False, | ||
win_private_assemblies: bool = False, | ||
noarchive: bool = False, | ||
module_collection_mode: Incomplete | None = None, | ||
# https://pyinstaller.org/en/stable/hooks.html#hook-global-variables | ||
module_collection_mode: dict[str, Literal["pyz", "pyc", "py", "pyz+py", "py+pyz"]] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we need to use dict[str, str]
, because it is hard to infer dict[str, Literal]
type.
Complete the incomplete types of Analysis class constructor params.