From 2e49569ed45751df4c6953466f9769336698c033 Mon Sep 17 00:00:00 2001 From: Mykola Mokhnach Date: Fri, 1 Sep 2023 13:52:27 +0200 Subject: [PATCH] feat!: Update selenium dependency to 4.12 (#908) BREAKING CHANGE: The minimum supported Python version set to 3.8 BREAKING CHANGE: The minimum supported selenium version set to 4.12 --- .github/workflows/unit-test.yml | 2 +- Pipfile | 3 +-- .../options/common/supports_capabilities.py | 4 +--- appium/protocols/protocol.py | 22 ------------------- .../webdriver/can_execute_commands.py | 4 +--- .../webdriver/can_execute_scripts.py | 4 +--- .../protocols/webdriver/can_find_elements.py | 4 +--- .../can_remember_extension_presence.py | 4 +--- appium/webdriver/switch_to.py | 3 +-- setup.py | 3 +-- tox.ini | 4 ++-- 11 files changed, 11 insertions(+), 46 deletions(-) delete mode 100644 appium/protocols/protocol.py diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index a57bbc74..c8123838 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/Pipfile b/Pipfile index e886a5be..b488c9c0 100644 --- a/Pipfile +++ b/Pipfile @@ -16,8 +16,7 @@ pytest = "~=7.4" pytest-cov = "~=4.1" python-dateutil = "~=2.8" tox = "~=4.8" -typing-extensions = "~=4.7" types-python-dateutil = "~=2.8" [packages] -selenium = "~=4.11" +selenium = "~=4.12" diff --git a/appium/options/common/supports_capabilities.py b/appium/options/common/supports_capabilities.py index b56f153c..89bf0d7f 100644 --- a/appium/options/common/supports_capabilities.py +++ b/appium/options/common/supports_capabilities.py @@ -15,9 +15,7 @@ # specific language governing permissions and limitations # under the License. -from typing import Any, TypeVar - -from appium.protocols.protocol import Protocol +from typing import Any, Protocol, TypeVar T = TypeVar('T') diff --git a/appium/protocols/protocol.py b/appium/protocols/protocol.py deleted file mode 100644 index 06daa903..00000000 --- a/appium/protocols/protocol.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys - -if sys.version_info >= (3, 8): - # noinspection PyUnresolvedReferences - from typing import Protocol -else: - # noinspection PyUnresolvedReferences - from typing_extensions import Protocol diff --git a/appium/protocols/webdriver/can_execute_commands.py b/appium/protocols/webdriver/can_execute_commands.py index 1c763c6e..d2673666 100644 --- a/appium/protocols/webdriver/can_execute_commands.py +++ b/appium/protocols/webdriver/can_execute_commands.py @@ -12,12 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Dict, Union +from typing import Dict, Protocol, Union from selenium.webdriver.remote.remote_connection import RemoteConnection -from ..protocol import Protocol - class CanExecuteCommands(Protocol): command_executor: RemoteConnection diff --git a/appium/protocols/webdriver/can_execute_scripts.py b/appium/protocols/webdriver/can_execute_scripts.py index 661a3880..0c120a13 100644 --- a/appium/protocols/webdriver/can_execute_scripts.py +++ b/appium/protocols/webdriver/can_execute_scripts.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import Any, List, Optional - -from ..protocol import Protocol +from typing import Any, List, Optional, Protocol class CanExecuteScripts(Protocol): diff --git a/appium/protocols/webdriver/can_find_elements.py b/appium/protocols/webdriver/can_find_elements.py index 8ab1bd64..5cd2a041 100644 --- a/appium/protocols/webdriver/can_find_elements.py +++ b/appium/protocols/webdriver/can_find_elements.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import TYPE_CHECKING, Dict, List, Union - -from ..protocol import Protocol +from typing import TYPE_CHECKING, Dict, List, Protocol, Union if TYPE_CHECKING: from appium.webdriver.webelement import WebElement diff --git a/appium/protocols/webdriver/can_remember_extension_presence.py b/appium/protocols/webdriver/can_remember_extension_presence.py index bf000393..1674c62b 100644 --- a/appium/protocols/webdriver/can_remember_extension_presence.py +++ b/appium/protocols/webdriver/can_remember_extension_presence.py @@ -12,9 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import TypeVar - -from ..protocol import Protocol +from typing import Protocol, TypeVar T = TypeVar('T') diff --git a/appium/webdriver/switch_to.py b/appium/webdriver/switch_to.py index 21e9393e..9ad5667b 100644 --- a/appium/webdriver/switch_to.py +++ b/appium/webdriver/switch_to.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import TYPE_CHECKING, Optional, cast +from typing import TYPE_CHECKING, Optional, Protocol, cast from selenium.webdriver.remote.switch_to import SwitchTo -from appium.protocols.protocol import Protocol from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands from .mobilecommand import MobileCommand diff --git a/setup.py b/setup.py index b4a56f02..628d0804 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,6 @@ classifiers=[ 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', @@ -50,5 +49,5 @@ 'Topic :: Software Development :: Quality Assurance', 'Topic :: Software Development :: Testing', ], - install_requires=['selenium ~= 4.1'], + install_requires=['selenium ~= 4.12'], ) diff --git a/tox.ini b/tox.ini index c4d757ab..223cf509 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] skipsdist = True envlist = - py37, py38, - py39 + py39, + py311 [testenv] deps =