Skip to content
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

Drop py37 support #12400

Merged
merged 13 commits into from
Aug 28, 2023
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- name: Checkout source tree
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7.10
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -40,10 +40,10 @@ jobs:
steps:
- name: Checkout source tree
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7.10
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -60,10 +60,10 @@ jobs:
steps:
- name: Checkout source tree
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7.10
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 1 addition & 2 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ py_wheel(
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -212,7 +211,7 @@ py_wheel(
distribution = "selenium",
homepage = "https://www.selenium.dev",
license = "Apache 2.0",
python_requires = ">=3.7",
python_requires = ">=3.8",
python_tag = "py3",
requires = [
"urllib3[socks]>=1.26,<3",
Expand Down
4 changes: 4 additions & 0 deletions py/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Selenium 4.11.0
* Drop support for `python3.7`
* Fixed a bug where `Popen.wait()` calls caught the wrong exceptions when timing out

Selenium 4.10.0
* Add CDP files for v114 and remove v111
* Fix bug preventing proxy from working in Options classes (#12029)
Expand Down
4 changes: 2 additions & 2 deletions py/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer), as
Supported Python Versions
=========================

* Python 3.7+
* Python 3.8+

Installing
==========
Expand Down Expand Up @@ -159,7 +159,7 @@ Contributing

- Create a branch for your work
- Ensure `tox` is installed (using a `virtualenv` is recommended)
- `python3.7 -m venv .venv && . .venv/bin/activate && pip install tox`
- `python3.8 -m venv .venv && . .venv/bin/activate && pip install tox`
- After making changes, before committing execute `tox -e linting`
- If tox exits `0`, commit and push otherwise fix the newly introduced breakages.
- `flake8` requires manual fixes
Expand Down
1 change: 0 additions & 1 deletion py/selenium/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""Exceptions that may happen in all the webdriver code."""

from typing import Optional
Expand Down
1 change: 0 additions & 1 deletion py/selenium/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

"""Selenium type definitions."""

import typing
Expand Down
37 changes: 12 additions & 25 deletions py/selenium/webdriver/chromium/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,36 @@ def __init__(self) -> None:

@property
def binary_location(self) -> str:
"""
:Returns: The location of the binary, otherwise an empty string
"""
""":Returns: The location of the binary, otherwise an empty string."""
return self._binary_location

@binary_location.setter
def binary_location(self, value: str) -> None:
"""
Allows you to set where the chromium binary lives
"""Allows you to set where the chromium binary lives.

:Args:
- value: path to the Chromium binary
"""
self._binary_location = value

@property
def debugger_address(self) -> str:
"""
:Returns: The address of the remote devtools instance
"""
""":Returns: The address of the remote devtools instance."""
return self._debugger_address

@debugger_address.setter
def debugger_address(self, value: str) -> None:
"""
Allows you to set the address of the remote devtools instance
that the ChromeDriver instance will try to connect to during an
active wait.
"""Allows you to set the address of the remote devtools instance that
the ChromeDriver instance will try to connect to during an active wait.

:Args:
- value: address of remote devtools instance if any (hostname[:port])
"""
self._debugger_address = value

@property
def extensions(self) -> List[str]:
"""
:Returns: A list of encoded extensions that will be loaded
"""
""":Returns: A list of encoded extensions that will be loaded."""

def _decode(file_data: BinaryIO) -> str:
# Should not use base64.encodestring() which inserts newlines every
Expand Down Expand Up @@ -120,9 +113,7 @@ def add_encoded_extension(self, extension: str) -> None:

@property
def experimental_options(self) -> dict:
"""
:Returns: A dictionary of experimental options for chromium
"""
""":Returns: A dictionary of experimental options for chromium."""
return self._experimental_options

def add_experimental_option(self, name: str, value: Union[str, int, dict, List[str]]) -> None:
Expand All @@ -136,9 +127,7 @@ def add_experimental_option(self, name: str, value: Union[str, int, dict, List[s

@property
def headless(self) -> bool:
"""
:Returns: True if the headless argument is set, else False
"""
""":Returns: True if the headless argument is set, else False."""
warnings.warn(
"headless property is deprecated, instead check for '--headless' in arguments",
DeprecationWarning,
Expand Down Expand Up @@ -168,10 +157,8 @@ def headless(self, value: bool) -> None:
self._arguments = list(set(self._arguments) - args)

def to_capabilities(self) -> dict:
"""
Creates a capabilities with all the options that have been set
:Returns: A dictionary with everything
"""
"""Creates a capabilities with all the options that have been set
:Returns: A dictionary with everything."""
caps = self._caps
chrome_options = self.experimental_options.copy()
if self.mobile_options:
Expand Down
16 changes: 6 additions & 10 deletions py/selenium/webdriver/chromium/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ def launch_app(self, id):
def get_network_conditions(self):
"""Gets Chromium network emulation settings.

:Returns:
A dict. For example:
{'latency': 4, 'download_throughput': 2, 'upload_throughput': 2,
'offline': False}
:Returns: A dict. For example: {'latency': 4,
diemol marked this conversation as resolved.
Show resolved Hide resolved
'download_throughput': 2, 'upload_throughput': 2, 'offline':
False}
"""
return self.execute("getNetworkConditions")["value"]

Expand Down Expand Up @@ -140,15 +139,12 @@ def execute_cdp_cmd(self, cmd: str, cmd_args: dict):
return self.execute("executeCdpCommand", {"cmd": cmd, "params": cmd_args})["value"]

def get_sinks(self) -> list:
"""
:Returns: A list of sinks available for Cast.
"""
""":Returns: A list of sinks available for Cast."""
return self.execute("getSinks")["value"]

def get_issue_message(self):
"""
:Returns: An error message when there is any issue in a Cast session.
"""
""":Returns: An error message when there is any issue in a Cast
session."""
return self.execute("getIssueMessage")["value"]

def set_sink_to_use(self, sink_name: str) -> dict:
Expand Down
Loading