fix: fix type checker errors for pyright#1203
Conversation
In `py.typed` modules, imported symbols considered private[^1], which is not importable by users. To become public interface, explicit `__all__` symbol is required. [^1]: https://typing.python.org/en/latest/spec/distributing.html#library-interface-public-and-private-symbols
Added deprecation warnings for unimplemented methods in CanExecuteScripts protocol.
|
|
||
| from typing import Any, List, Optional, Protocol | ||
| from typing import Any, List, Optional, Protocol, TYPE_CHECKING | ||
| from warings import deprecated |
| # TODO: remove `if not TYPE_CHECKING` guard after properly implement them | ||
| # The use of these methods will produce DeprecationWarnings at runtime | ||
| if not TYPE_CHECKING: | ||
| @deprecated("pin_script is not yet implemented") |
There was a problem hiding this comment.
I would rather say is deprecated for removal
There was a problem hiding this comment.
I assumed those methods would be implemented later. If there are no plans to do so, I will make the changes as you suggested.
There was a problem hiding this comment.
I am not sure it makes sense to implement them in mobile context, but it still makes sense to confirm that with other maintainers
| Appium Python Client: WebDriver module | ||
| """ | ||
|
|
||
| __all__ = ["Remote", "WebElement"] |
There was a problem hiding this comment.
This change looks reasonable to me. This fixes mypy --strict also.
KazuCocoa
left a comment
There was a problem hiding this comment.
Lg to me. Waiting for the CI result
|
Hi @ilotoki0804, congrats: the Appium project wants to compensate you for this contribution! Please reply to this comment mentioning @jlipps and @KazuCocoa and sharing your OpenCollective account name, so that we can initiate payment! Or let us know if you decline to receive compensation via OpenCollective. Thank you! |
|
@jlipps @KazuCocoa My OpenCollective username is ilotoki0804. Thank you so much! |
For a more detailed explanation, please refer to this link.