Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/ScreenPyHQ/cookiecutter_screenpy",
"commit": "4ad86820b5729801d7c765e04cfda2e953671164",
"commit": "6a7488b4183f615ff319dbfdac38a3a1354953c7",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -11,7 +11,8 @@
"author": "Perry Goy",
"author_email": "[email protected]",
"github_username": "ScreenPyHQ",
"_template": "https://github.com/ScreenPyHQ/cookiecutter_screenpy"
"_template": "https://github.com/ScreenPyHQ/cookiecutter_screenpy",
"_commit": "6a7488b4183f615ff319dbfdac38a3a1354953c7"
}
},
"directory": null
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cruft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
python-version: ["3.13"]
os: [ubuntu-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest]

steps:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.12"]
python-version: ["3.13"]
os: [ubuntu-latest]
poetry-version: ["1.6.1"]
poetry-version: ["2.1.3"]

steps:
- uses: actions/checkout@v4
Expand All @@ -32,8 +32,5 @@ jobs:
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Check toml structure
run: poetry check

- name: Check lock file
run: poetry lock --check
- name: Check lock file is consistent with pyproject
run: poetry check --lock
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest]

steps:
Expand Down
19 changes: 0 additions & 19 deletions .pre-commit-config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2024 Perry Goy
Copyright (c) 2022-2025 Perry Goy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,23 @@ mypy:

.PHONY: black-check black-fix ruff-check ruff-fix mypy

lint: black-check ruff-check

lint-fix: black-fix ruff-fix

pre-check-in: black-check ruff-check mypy

pre-check-in-fix: black-fix ruff-fix mypy

.PHONY: pre-check-in pre-check-in-fix
.PHONY: pre-check-in pre-check-in-fix lint lint-fix

# requires poetry-plugin-export
requirements:
poetry export --without-hashes --extras dev -f requirements.txt > requirements.txt

.PHONY: requirements

cruft-update:
cruft update --allow-untracked-files

.PHONY: cruft-update
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ You want to contribute? Great! Here are the things you should do before submitti
1. `pip install -e .[dev]`
1. Optional (poetry users):
1. `poetry install --extras dev`
1. Run `pre-commit install` once.
1. Run `tox` to perform tests frequently.
1. Create pull-request from your branch.

Expand Down
1,660 changes: 945 additions & 715 deletions poetry.lock

Large diffs are not rendered by default.

80 changes: 28 additions & 52 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build-backend = "poetry.core.masonry.api"


[tool.black]
target-version = ['py312']
target-version = ['py313']
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
Expand All @@ -36,7 +36,7 @@ extend-exclude = '''


[tool.ruff]
target-version = "py38" # minimum supported version
target-version = "py39" # minimum supported version
line-length = 88 # same as Black.
output-format = "concise"
extend-exclude = [
Expand All @@ -45,59 +45,25 @@ extend-exclude = [

[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle error
"EM", # flake8-errmsg
"ERA", # eradicate
"F", # Pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
"FIX", # flake8-fixme
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff specific
"SIM", # flake8-simplify
"T10", # flake8-debugger
"T20", # flake8-print
"TCH", # flake8-type-checking
"TRY", # tryceratops
"UP", # python upgrade
"W", # pycodestyle warning
"YTT", # flake8-2020

# we would like these someday, but not yet
# "FURB", # refurb
"ALL", # let's get all the new hotness and ignore as we need!
]
ignore = [
"D107", # missing __init__ docstring, we do that in the class docstring.
"D203", # one blank line before class docstring, no thanks!
"D212", # multi line summary first line, we want a one line summary.
"ANN101", # missing self annotation, we only annotate self when we return it.
"ANN102", # missing cls annotation, we only annotate cls when we return it.
"COM812", # we prefer black's logic for trailing commas
"D107", # missing __init__ docstring, we do that in the class docstring.
"D203", # one blank line before class docstring, no thanks!
"D212", # multi line summary first line, we want a one line summary.
"E501", # black handles our line limits.
"N818", # we like our conventions with readable error classes.
"S608", # we will not have SQL injection concerns. :P
]

extend-safe-fixes = [
"EM101", "EM102",
"TCH001", "TCH002", "TCH003", "TCH004",
"C419",
"D200", "D205", "D415",
"EM101", "EM102",
"PT003", "PT006", "PT018",
"RET504",
"TCH001", "TCH002", "TCH003", "TCH004",
"UP006", "UP007",
"W291",
]
Expand All @@ -120,17 +86,27 @@ split-on-trailing-comma = false

[tool.ruff.lint.per-file-ignores]
"tests/**" = [
"D", # we don't need public-API-polished docstrings in tests.
"FBT", # using a boolean as a test object is useful!
"PLR", # likewise using specific numbers and strings in tests.
"A", # import __doc__ is shadowing python builtin
"D", # we don't need public-API-polished docstrings in tests.
"FBT", # using a boolean as a test object is useful!
"N802", # we are intentional about our capitalization!
"N803", # we like our standards for variable names in tests.
"N806", # we are intentional about our capitalization!
"PLR", # using specific numbers and strings in tests is useful!
"PYI034", # our Fake-ables need to be... weird.
"S101", # we want to assert in tests!
"SLF001", # we need to access private methods in tests.
]
"__version__.py" = ["D"]
"__version__.py" = [
"D", # we don't need public-API-polished docstrings in version.
]


################################################################################
# END OF BOILERPLATE ScreenPyHQ CONFIGURATIONS #
################################################################################


[tool.poetry]
name = "screenpy_appium"
version = "0.0.2"
Expand All @@ -144,11 +120,11 @@ readme = "README.md"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Quality Assurance",
Expand All @@ -167,7 +143,7 @@ classifiers = [
# so we dont have two different sets of package versions to update.

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"

screenpy = ">=4.0.2"
Appium-Python-Client = ">=2.0"
Expand Down
2 changes: 1 addition & 1 deletion screenpy_appium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ScreenPy Appium is an extension for ScreenPy, enabling interaction with Appium.

:copyright: (c) 2022-2024, Perry Goy.
:copyright: (c) 2022-2025, Perry Goy.
:license: MIT, see LICENSE for more details.
"""

Expand Down
38 changes: 19 additions & 19 deletions screenpy_appium/__version__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"""
.s5SSSs. .s5SSSs. .s5SSSs. .s5SSSs. .s5SSSs. .s s. .s5SSSs. .s5 s.
SS. SS. SS. SS. SS. SS. SS. SS.
sS `:; sS `:; sS S%S sS `:; sS `:; sSs. S%S sS S%S ssS SSS
SS SS SS S%S SS SS SS`S. S%S SS S%S SSS SSS
`:;;;;. SS SS .sS;:' SSSs. SSSs. SS `S.S%S SS .sS::' SSSSS
;;. SS SS ;, SS SS SS `sS%S SS SSS
`:; SS SS `:; SS SS SS `:; SS `:;
.,; ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,.
`:;;;;;:' `:;;;;;:' `: ;:' `:;;;;;:' `:;;;;;:' :; ;:' `: ;:'
.s5SSSs. .s5SSSs. .s5SSSs. .s5SSSs. .s5SSSs. .s s. .s5SSSs. .s5 s.
SS. SS. SS. SS. SS. SS. SS. SS.
sS `:; sS `:; sS S%S sS `:; sS `:; sSs. S%S sS S%S ssS SSS
SS SS SS S%S SS SS SS`S. S%S SS S%S SSS SSS
`:;;;;. SS SS .sS;:' SSSs. SSSs. SS `S.S%S SS .sS::' SSSSS
;;. SS SS ;, SS SS SS `sS%S SS SSS
`:; SS SS `:; SS SS SS `:; SS `:;
.,; ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,. SS ;,.
`:;;;;;:' `:;;;;;:' `: ;:' `:;;;;;:' `:;;;;;:' :; ;:' `: ;:'

.s5SSSs. .s5SSSs. .s5SSSs. s. .s s. .s5ssSs.
SS. SS. SS. SS. SS. SS SS.
sS S%S sS S%S sS S%S S%S sS S%S sS SS S%S
SS S%S SS S%S SS S%S S%S SS S%S SS :; S%S
SSSs. S%S SS .sS::' SS .sS::' S%S SS S%S SS S%S
SS S%S SS SS S%S SS S%S SS S%S
SS `:; SS SS `:; SS `:; SS `:;
SS ;,. SS SS ;,. SS ;,. SS ;,.
:; ;:' `: `: ;:' `:;;;;;:' :; ;:'
.s5SSSs. .s5SSSs. .s5SSSs. s. .s s. .s5ssSs.
SS. SS. SS. SS. SS. SS SS.
sS S%S sS S%S sS S%S S%S sS S%S sS SS S%S
SS S%S SS S%S SS S%S S%S SS S%S SS :; S%S
SSSs. S%S SS .sS::' SS .sS::' S%S SS S%S SS S%S
SS S%S SS SS S%S SS S%S SS S%S
SS `:; SS SS `:; SS `:; SS `:;
SS ;,. SS SS ;,. SS ;,. SS ;,.
:; ;:' `: `: ;:' `:;;;;;:' :; ;:'
"""

import importlib.metadata
Expand All @@ -31,4 +31,4 @@
__author__ = metadata["Author"]
__author_email__ = metadata["Author-email"]
__license__ = metadata["License"]
__copyright__ = f"2019-2024 {__author__}"
__copyright__ = f"2019-2025 {__author__}"
2 changes: 1 addition & 1 deletion screenpy_appium/actions/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if TYPE_CHECKING:
from screenpy.actor import Actor

from ..target import Target
from screenpy_appium.target import Target


class Clear:
Expand Down
4 changes: 2 additions & 2 deletions screenpy_appium/actions/enter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from screenpy.exceptions import DeliveryError, UnableToAct
from screenpy.pacing import beat

from ..common import pos_args_deprecated
from screenpy_appium.common import pos_args_deprecated

if TYPE_CHECKING:
from screenpy import Actor

from ..target import Target
from screenpy_appium.target import Target


class Enter:
Expand Down
2 changes: 1 addition & 1 deletion screenpy_appium/actions/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if TYPE_CHECKING:
from screenpy.actor import Actor

from ..target import Target
from screenpy_appium.target import Target


class Tap:
Expand Down
7 changes: 3 additions & 4 deletions screenpy_appium/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@

P = ParamSpec("P")
T = TypeVar("T")
Function = Callable[P, T]


def pos_args_deprecated(*keywords: str) -> Function:
def pos_args_deprecated(*keywords: str) -> Callable:
"""Warn users which positional arguments should be called via keyword."""

def deprecated(func: Function) -> Function:
def deprecated(func: Callable) -> Callable:
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) -> Function:
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Callable[P, T]:
Copy link
Contributor

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:

# call the function first, to make sure the signature matches
ret_value = func(*args, **kwargs)

Expand Down
Loading