Skip to content

Commit 98d4640

Browse files
symonkdiemol
andauthored
Drop py37 support (#12400)
* [py]: Upgrading syntax to be `python3.8+` * [py]: Upgrade infrastructure for `python3.8+` * [py] Remove accidental commit of pre commit config used for upgrading * [py]: Remove py37 classifiers from bazel python packaging recipes * [py]: Apply `flake8` with py3.8 - update docstrings inline with `PEP-257` * [py]: Use more python3.8+ syntax * [py]: Remove old python3.7 comments in code * [py] Apply more python3.8+ type hints * [py]: Fix conflicts and make `CHANGES` accurate --------- Co-authored-by: Diego Molina <[email protected]>
1 parent 09674ae commit 98d4640

38 files changed

+127
-201
lines changed

.github/workflows/ci-python.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
steps:
2121
- name: Checkout source tree
2222
uses: actions/checkout@v3
23-
- name: Set up Python 3.7
23+
- name: Set up Python 3.8
2424
uses: actions/setup-python@v4
2525
with:
26-
python-version: 3.7.10
26+
python-version: 3.8
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
@@ -40,10 +40,10 @@ jobs:
4040
steps:
4141
- name: Checkout source tree
4242
uses: actions/checkout@v3
43-
- name: Set up Python 3.7
43+
- name: Set up Python 3.8
4444
uses: actions/setup-python@v4
4545
with:
46-
python-version: 3.7.10
46+
python-version: 3.8
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip
@@ -60,10 +60,10 @@ jobs:
6060
steps:
6161
- name: Checkout source tree
6262
uses: actions/checkout@v3
63-
- name: Set up Python 3.7
63+
- name: Set up Python 3.8
6464
uses: actions/setup-python@v4
6565
with:
66-
python-version: 3.7.10
66+
python-version: 3.8
6767
- name: Install dependencies
6868
run: |
6969
python -m pip install --upgrade pip

py/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ py_wheel(
203203
"Topic :: Software Development :: Testing",
204204
"Topic :: Software Development :: Libraries",
205205
"Programming Language :: Python",
206-
"Programming Language :: Python :: 3.7",
207206
"Programming Language :: Python :: 3.8",
208207
"Programming Language :: Python :: 3.9",
209208
"Programming Language :: Python :: 3.10",
@@ -212,7 +211,7 @@ py_wheel(
212211
distribution = "selenium",
213212
homepage = "https://www.selenium.dev",
214213
license = "Apache 2.0",
215-
python_requires = ">=3.7",
214+
python_requires = ">=3.8",
216215
python_tag = "py3",
217216
requires = [
218217
"urllib3[socks]>=1.26,<3",

py/CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Selenium 4.12.0
77
* fix bug in common options (#12499)
88
* allow setting http client certifications with REQUESTS_CA_BUNDLE env (#11957)
99
* support conda installation of selenium manager (#12536)
10-
11-
10+
* Drop support for `python3.7`
11+
* Fixed a bug where `Popen.wait()` calls caught the wrong exceptions when timing out
1212

1313
Selenium 4.11.2
1414
* better bug fix for #12454

py/docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer), as
2424
Supported Python Versions
2525
=========================
2626

27-
* Python 3.7+
27+
* Python 3.8+
2828

2929
Installing
3030
==========
@@ -148,7 +148,7 @@ Contributing
148148

149149
- Create a branch for your work
150150
- Ensure `tox` is installed (using a `virtualenv` is recommended)
151-
- `python3.7 -m venv .venv && . .venv/bin/activate && pip install tox`
151+
- `python3.8 -m venv .venv && . .venv/bin/activate && pip install tox`
152152
- After making changes, before committing execute `tox -e linting`
153153
- If tox exits `0`, commit and push otherwise fix the newly introduced breakages.
154154
- `flake8` requires manual fixes

py/selenium/common/exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1817
"""Exceptions that may happen in all the webdriver code."""
1918

2019
from typing import Optional

py/selenium/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
1817
"""Selenium type definitions."""
1918

2019
import typing

py/selenium/webdriver/chromium/options.py

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ def __init__(self) -> None:
3939

4040
@property
4141
def binary_location(self) -> str:
42-
"""
43-
:Returns: The location of the binary, otherwise an empty string
44-
"""
42+
""":Returns: The location of the binary, otherwise an empty string."""
4543
return self._binary_location
4644

4745
@binary_location.setter
4846
def binary_location(self, value: str) -> None:
49-
"""
50-
Allows you to set where the chromium binary lives
47+
"""Allows you to set where the chromium binary lives.
48+
5149
:Args:
5250
- value: path to the Chromium binary
5351
"""
@@ -57,17 +55,14 @@ def binary_location(self, value: str) -> None:
5755

5856
@property
5957
def debugger_address(self) -> str:
60-
"""
61-
:Returns: The address of the remote devtools instance
62-
"""
58+
""":Returns: The address of the remote devtools instance."""
6359
return self._debugger_address
6460

6561
@debugger_address.setter
6662
def debugger_address(self, value: str) -> None:
67-
"""
68-
Allows you to set the address of the remote devtools instance
69-
that the ChromeDriver instance will try to connect to during an
70-
active wait.
63+
"""Allows you to set the address of the remote devtools instance that
64+
the ChromeDriver instance will try to connect to during an active wait.
65+
7166
:Args:
7267
- value: address of remote devtools instance if any (hostname[:port])
7368
"""
@@ -77,9 +72,7 @@ def debugger_address(self, value: str) -> None:
7772

7873
@property
7974
def extensions(self) -> List[str]:
80-
"""
81-
:Returns: A list of encoded extensions that will be loaded
82-
"""
75+
""":Returns: A list of encoded extensions that will be loaded."""
8376

8477
def _decode(file_data: BinaryIO) -> str:
8578
# Should not use base64.encodestring() which inserts newlines every
@@ -124,9 +117,7 @@ def add_encoded_extension(self, extension: str) -> None:
124117

125118
@property
126119
def experimental_options(self) -> dict:
127-
"""
128-
:Returns: A dictionary of experimental options for chromium
129-
"""
120+
""":Returns: A dictionary of experimental options for chromium."""
130121
return self._experimental_options
131122

132123
def add_experimental_option(self, name: str, value: Union[str, int, dict, List[str]]) -> None:
@@ -140,9 +131,7 @@ def add_experimental_option(self, name: str, value: Union[str, int, dict, List[s
140131

141132
@property
142133
def headless(self) -> bool:
143-
"""
144-
:Returns: True if the headless argument is set, else False
145-
"""
134+
""":Returns: True if the headless argument is set, else False."""
146135
warnings.warn(
147136
"headless property is deprecated, instead check for '--headless' in arguments",
148137
DeprecationWarning,
@@ -176,10 +165,8 @@ def headless(self, value: bool) -> None:
176165
self._arguments = list(set(self._arguments) - args)
177166

178167
def to_capabilities(self) -> dict:
179-
"""
180-
Creates a capabilities with all the options that have been set
181-
:Returns: A dictionary with everything
182-
"""
168+
"""Creates a capabilities with all the options that have been set
169+
:Returns: A dictionary with everything."""
183170
caps = self._caps
184171
chrome_options = self.experimental_options.copy()
185172
if self.mobile_options:

py/selenium/webdriver/chromium/webdriver.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ def launch_app(self, id):
7575
def get_network_conditions(self):
7676
"""Gets Chromium network emulation settings.
7777
78-
:Returns:
79-
A dict. For example:
80-
{'latency': 4, 'download_throughput': 2, 'upload_throughput': 2,
81-
'offline': False}
78+
:Returns: A dict. For example: {'latency': 4,
79+
'download_throughput': 2, 'upload_throughput': 2, 'offline':
80+
False}
8281
"""
8382
return self.execute("getNetworkConditions")["value"]
8483

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

142141
def get_sinks(self) -> list:
143-
"""
144-
:Returns: A list of sinks available for Cast.
145-
"""
142+
""":Returns: A list of sinks available for Cast."""
146143
return self.execute("getSinks")["value"]
147144

148145
def get_issue_message(self):
149-
"""
150-
:Returns: An error message when there is any issue in a Cast session.
151-
"""
146+
""":Returns: An error message when there is any issue in a Cast
147+
session."""
152148
return self.execute("getIssueMessage")["value"]
153149

154150
def set_sink_to_use(self, sink_name: str) -> dict:

0 commit comments

Comments
 (0)