Skip to content

Commit 5372257

Browse files
authored
Merge pull request #259 from plugwise/python311
WIP: Prepare Python 3.11
2 parents 9ac41f2 + 28e2aaa commit 5372257

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

.github/workflows/verify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 2
7+
CACHE_VERSION: 3
88
DEFAULT_PYTHON: "3.10"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

@@ -160,7 +160,7 @@ jobs:
160160
needs: commitcheck
161161
strategy:
162162
matrix:
163-
python-version: [3.9, "3.10"]
163+
python-version: [3.9, "3.10", "3.11"]
164164
steps:
165165
- name: Check out committed code
166166
uses: actions/checkout@v3
@@ -199,7 +199,7 @@ jobs:
199199
needs: prepare-test-cache
200200
strategy:
201201
matrix:
202-
python-version: [3.9, "3.10"]
202+
python-version: [3.9, "3.10", "3.11"]
203203

204204
steps:
205205
- name: Check out committed code

plugwise/connections/socket.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ def _open_connection(self):
3939
err,
4040
)
4141
raise PortError(err)
42-
else:
43-
self._reader_start("socket_reader_thread")
44-
self._writer_start("socket_writer_thread")
45-
self._is_connected = True
46-
_LOGGER.debug(
47-
"Successfully connected to host '%s' at port %s",
48-
self._socket_host,
49-
str(self._socket_port),
50-
)
42+
self._reader_start("socket_reader_thread")
43+
self._writer_start("socket_writer_thread")
44+
self._is_connected = True
45+
_LOGGER.debug(
46+
"Successfully connected to host '%s' at port %s",
47+
self._socket_host,
48+
str(self._socket_port),
49+
)
5150

5251
def _close_connection(self):
5352
"""Close the socket."""
@@ -76,8 +75,7 @@ def _read_data(self):
7675
)
7776
self._is_connected = False
7877
raise PortError(err)
79-
else:
80-
return socket_data
78+
return socket_data
8179
return None
8280

8381
def _write_data(self, data):

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ classifiers = [
1616
"Operating System :: OS Independent",
1717
"Programming Language :: Python :: 3.9",
1818
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
1920
"Topic :: Home Automation",
2021
]
2122
authors = [
@@ -50,7 +51,7 @@ include-package-data = true
5051
include = ["plugwise*"]
5152

5253
[tool.black]
53-
target-version = ["py39", "py310"]
54+
target-version = ["py39", "py310", "py311"]
5455
exclude = 'generated'
5556

5657
[tool.isort]
@@ -166,9 +167,8 @@ expected-line-ending-format = "LF"
166167

167168
[tool.pylint.EXCEPTIONS]
168169
overgeneral-exceptions = [
169-
"BaseException",
170-
"Exception",
171-
"HomeAssistantError",
170+
"builtins.BaseException",
171+
"builtins.Exception",
172172
]
173173

174174
[tool.pytest.ini_options]
@@ -187,7 +187,7 @@ norecursedirs = [
187187
]
188188

189189
[tool.mypy]
190-
python_version = "3.10"
190+
python_version = "3.11"
191191
show_error_codes = true
192192
follow_imports = "silent"
193193
ignore_missing_imports = true

scripts/python-venv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -eu
33

4-
pyversions=(3.10 3.9)
4+
pyversions=(3.11 3.10 3.9)
55
my_path=$(git rev-parse --show-toplevel)
66
my_venv=${my_path}/venv
77

0 commit comments

Comments
 (0)