Skip to content

Commit fde053a

Browse files
authored
[py] Convert all relative imports to absolute imports (#16311)
1 parent f5ad7eb commit fde053a

32 files changed

+112
-131
lines changed

py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ respect-gitignore = true
144144
target-version = "py39"
145145

146146
[tool.ruff.lint]
147-
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022"]
147+
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"]
148148
fixable = ["ALL"]
149149

150150
[tool.ruff.format]

py/selenium/common/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from .exceptions import (
18+
from selenium.common.exceptions import (
1919
DetachedShadowRootException,
2020
ElementClickInterceptedException,
2121
ElementNotInteractableException,

py/selenium/webdriver/__init__.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from .chrome.options import Options as ChromeOptions # noqa
19-
from .chrome.service import Service as ChromeService # noqa
20-
from .chrome.webdriver import WebDriver as Chrome # noqa
21-
from .common.action_chains import ActionChains # noqa
22-
from .common.desired_capabilities import DesiredCapabilities # noqa
23-
from .common.keys import Keys # noqa
24-
from .common.proxy import Proxy # noqa
25-
from .edge.options import Options as EdgeOptions # noqa
26-
from .edge.service import Service as EdgeService # noqa
27-
from .edge.webdriver import WebDriver as ChromiumEdge # noqa
28-
from .edge.webdriver import WebDriver as Edge # noqa
29-
from .firefox.firefox_profile import FirefoxProfile # noqa
30-
from .firefox.options import Options as FirefoxOptions # noqa
31-
from .firefox.service import Service as FirefoxService # noqa
32-
from .firefox.webdriver import WebDriver as Firefox # noqa
33-
from .ie.options import Options as IeOptions # noqa
34-
from .ie.service import Service as IeService # noqa
35-
from .ie.webdriver import WebDriver as Ie # noqa
36-
from .remote.webdriver import WebDriver as Remote # noqa
37-
from .safari.options import Options as SafariOptions
38-
from .safari.service import Service as SafariService # noqa
39-
from .safari.webdriver import WebDriver as Safari # noqa
40-
from .webkitgtk.options import Options as WebKitGTKOptions # noqa
41-
from .webkitgtk.service import Service as WebKitGTKService # noqa
42-
from .webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
43-
from .wpewebkit.options import Options as WPEWebKitOptions # noqa
44-
from .wpewebkit.service import Service as WPEWebKitService # noqa
45-
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
18+
from selenium.webdriver.chrome.options import Options as ChromeOptions # noqa
19+
from selenium.webdriver.chrome.service import Service as ChromeService # noqa
20+
from selenium.webdriver.chrome.webdriver import WebDriver as Chrome # noqa
21+
from selenium.webdriver.common.action_chains import ActionChains # noqa
22+
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities # noqa
23+
from selenium.webdriver.common.keys import Keys # noqa
24+
from selenium.webdriver.common.proxy import Proxy # noqa
25+
from selenium.webdriver.edge.options import Options as EdgeOptions # noqa
26+
from selenium.webdriver.edge.service import Service as EdgeService # noqa
27+
from selenium.webdriver.edge.webdriver import WebDriver as ChromiumEdge # noqa
28+
from selenium.webdriver.edge.webdriver import WebDriver as Edge # noqa
29+
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile # noqa
30+
from selenium.webdriver.firefox.options import Options as FirefoxOptions # noqa
31+
from selenium.webdriver.firefox.service import Service as FirefoxService # noqa
32+
from selenium.webdriver.firefox.webdriver import WebDriver as Firefox # noqa
33+
from selenium.webdriver.ie.options import Options as IeOptions # noqa
34+
from selenium.webdriver.ie.service import Service as IeService # noqa
35+
from selenium.webdriver.ie.webdriver import WebDriver as Ie # noqa
36+
from selenium.webdriver.remote.webdriver import WebDriver as Remote # noqa
37+
from selenium.webdriver.safari.options import Options as SafariOptions
38+
from selenium.webdriver.safari.service import Service as SafariService # noqa
39+
from selenium.webdriver.safari.webdriver import WebDriver as Safari # noqa
40+
from selenium.webdriver.webkitgtk.options import Options as WebKitGTKOptions # noqa
41+
from selenium.webdriver.webkitgtk.service import Service as WebKitGTKService # noqa
42+
from selenium.webdriver.webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
43+
from selenium.webdriver.wpewebkit.options import Options as WPEWebKitOptions # noqa
44+
from selenium.webdriver.wpewebkit.service import Service as WPEWebKitService # noqa
45+
from selenium.webdriver.wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
4646

4747
__version__ = "4.36.0.202508121825"
4848

py/selenium/webdriver/chrome/webdriver.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717

1818
from typing import Optional
1919

20+
from selenium.webdriver.chrome.options import Options
21+
from selenium.webdriver.chrome.service import Service
2022
from selenium.webdriver.chromium.webdriver import ChromiumDriver
2123
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
2224

23-
from .options import Options
24-
from .service import Service
25-
2625

2726
class WebDriver(ChromiumDriver):
2827
"""Controls the ChromeDriver and allows you to drive the browser."""

py/selenium/webdriver/common/action_chains.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020

2121
from typing import TYPE_CHECKING, Union
2222

23+
from selenium.webdriver.common.actions.action_builder import ActionBuilder
24+
from selenium.webdriver.common.actions.key_input import KeyInput
25+
from selenium.webdriver.common.actions.pointer_input import PointerInput
26+
from selenium.webdriver.common.actions.wheel_input import ScrollOrigin, WheelInput
27+
from selenium.webdriver.common.utils import keys_to_typing
2328
from selenium.webdriver.remote.webelement import WebElement
2429

25-
from .actions.action_builder import ActionBuilder
26-
from .actions.key_input import KeyInput
27-
from .actions.pointer_input import PointerInput
28-
from .actions.wheel_input import ScrollOrigin, WheelInput
29-
from .utils import keys_to_typing
30-
3130
if TYPE_CHECKING:
3231
from selenium.webdriver.remote.webdriver import WebDriver
3332

py/selenium/webdriver/common/actions/action_builder.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@
1818

1919
from typing import Any, Optional, Union
2020

21+
from selenium.webdriver.common.actions import interaction
22+
from selenium.webdriver.common.actions.key_actions import KeyActions
23+
from selenium.webdriver.common.actions.key_input import KeyInput
24+
from selenium.webdriver.common.actions.pointer_actions import PointerActions
25+
from selenium.webdriver.common.actions.pointer_input import PointerInput
26+
from selenium.webdriver.common.actions.wheel_actions import WheelActions
27+
from selenium.webdriver.common.actions.wheel_input import WheelInput
2128
from selenium.webdriver.remote.command import Command
2229

23-
from . import interaction
24-
from .key_actions import KeyActions
25-
from .key_input import KeyInput
26-
from .pointer_actions import PointerActions
27-
from .pointer_input import PointerInput
28-
from .wheel_actions import WheelActions
29-
from .wheel_input import WheelInput
30-
3130

3231
class ActionBuilder:
3332
def __init__(

py/selenium/webdriver/common/actions/interaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
from typing import Union
1818

19-
from .input_device import InputDevice
19+
from selenium.webdriver.common.actions.input_device import InputDevice
2020

2121
KEY = "key"
2222
POINTER = "pointer"

py/selenium/webdriver/common/actions/key_actions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
from __future__ import annotations
1919

20-
from ..utils import keys_to_typing
21-
from .interaction import KEY, Interaction
22-
from .key_input import KeyInput
23-
from .pointer_input import PointerInput
24-
from .wheel_input import WheelInput
20+
from selenium.webdriver.common.actions.interaction import KEY, Interaction
21+
from selenium.webdriver.common.actions.key_input import KeyInput
22+
from selenium.webdriver.common.actions.pointer_input import PointerInput
23+
from selenium.webdriver.common.actions.wheel_input import WheelInput
24+
from selenium.webdriver.common.utils import keys_to_typing
2525

2626

2727
class KeyActions(Interaction):

py/selenium/webdriver/common/actions/key_input.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
from . import interaction
18-
from .input_device import InputDevice
19-
from .interaction import Interaction, Pause
17+
from selenium.webdriver.common.actions import interaction
18+
from selenium.webdriver.common.actions.input_device import InputDevice
19+
from selenium.webdriver.common.actions.interaction import Interaction, Pause
2020

2121

2222
class KeyInput(InputDevice):

py/selenium/webdriver/common/actions/pointer_actions.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
# under the License.
1717
from typing import Optional
1818

19+
from selenium.webdriver.common.actions import interaction
20+
from selenium.webdriver.common.actions.interaction import Interaction
21+
from selenium.webdriver.common.actions.mouse_button import MouseButton
22+
from selenium.webdriver.common.actions.pointer_input import PointerInput
1923
from selenium.webdriver.remote.webelement import WebElement
2024

21-
from . import interaction
22-
from .interaction import Interaction
23-
from .mouse_button import MouseButton
24-
from .pointer_input import PointerInput
25-
2625

2726
class PointerActions(Interaction):
2827
def __init__(self, source: Optional[PointerInput] = None, duration: int = 250):

0 commit comments

Comments
 (0)