Skip to content

fix: fix type checker errors for pyright#1203

Merged
KazuCocoa merged 10 commits intoappium:masterfrom
ilotoki0804:ilotoki0804-patch-1
Mar 5, 2026
Merged

fix: fix type checker errors for pyright#1203
KazuCocoa merged 10 commits intoappium:masterfrom
ilotoki0804:ilotoki0804-patch-1

Conversation

@ilotoki0804
Copy link
Copy Markdown
Contributor

For a more detailed explanation, please refer to this link.

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
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 2, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opps😅

# 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")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would rather say is deprecated for removal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I assumed those methods would be implemented later. If there are no plans to do so, I will make the changes as you suggested.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This change looks reasonable to me. This fixes mypy --strict also.

Copy link
Copy Markdown
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

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

Lg to me. Waiting for the CI result

@KazuCocoa KazuCocoa changed the title fix: Fix type checker errors fix: fix type checker errors for pyright Mar 5, 2026
@KazuCocoa KazuCocoa merged commit cd4699a into appium:master Mar 5, 2026
13 checks passed
@KazuCocoa KazuCocoa added the size:S contribution size: S label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S contribution size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants