-
Notifications
You must be signed in to change notification settings - Fork 2
#7: Remove Python 3.8 support, add Python 3.13 support #8
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
base: trunk
Are you sure you want to change the base?
Conversation
screenpy_appium/common.py
Outdated
|
||
@wraps(func) | ||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Function: | ||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Callable[P, T]: |
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.
Dang, this was so so so incorrect. I'm actually surprised even the old mypy allowed it.
This is what it should be:
def pos_args_deprecated(*keywords: str) -> Callable[[Callable[P, T]], Callable[P, T]]:
"""Warn users which positional arguments should be called via keyword."""
def deprecated(func: Callable[P, T]) -> Callable[P, T]:
argnames = func.__code__.co_varnames[: func.__code__.co_argcount]
i = min([argnames.index(kw) for kw in keywords])
kw_argnames = argnames[i:]
@wraps(func)
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
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.
It's my fault, but the annotations in common.py are way off.
driver = the_actor.ability_to(UseAMobileDevice).driver | ||
try: | ||
return driver.find_element(*self) | ||
# bug in Selenium https://github.com/SeleniumHQ/selenium/issues/16035 |
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.
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.
The Appium team was fast -- they released 5.1.3 with the changes that fix the mypy error here.
Python 3.8 has reached its end-of-life, so let's remove that. Also let's add Python 3.13 while we're at it, and update all the files to use the new rules from
black
,ruff
, andmypy
!This PR is almost entirely mechanical, with some small tweaks for
mypy
to be happy.