Skip to content

Commit 96f2963

Browse files
authored
Merge pull request #132 from plugwise/deprecate38
Python 3.9 default and small left-over linting
2 parents fe1ba5a + b825d3d commit 96f2963

File tree

13 files changed

+105
-81
lines changed

13 files changed

+105
-81
lines changed

.github/workflows/merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest release
55

66
env:
7-
CACHE_VERSION: 3
7+
CACHE_VERSION: 4
88
DEFAULT_PYTHON: 3.9
99

1010
# Only run on merges

.github/workflows/verify.yml

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

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

1111
on:
1212
schedule:
13-
- cron: "0 0 * * 0" # weekly
13+
- cron: "2 4 * * 0" # weekly
1414
workflow_dispatch:
1515
push:
1616
# pull_request:
@@ -167,7 +167,7 @@ jobs:
167167
needs: commitcheck
168168
strategy:
169169
matrix:
170-
python-version: [3.8, 3.9, "3.10"]
170+
python-version: [3.9, "3.10"]
171171
steps:
172172
- name: Check out committed code
173173
uses: actions/checkout@v2
@@ -206,7 +206,7 @@ jobs:
206206
needs: prepare-test-cache
207207
strategy:
208208
matrix:
209-
python-version: [3.8, 3.9, "3.10"]
209+
python-version: [3.9, "3.10"]
210210

211211
steps:
212212
- name: Check out committed code

.pre-commit-config.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
default_language_version:
2+
# force all unspecified python hooks to run python3
3+
python: python3.9
14
repos:
25
# Run manually in CI skipping the branch checks
36
- repo: https://github.com/PyCQA/pylint
47
rev: v2.12.2
58
hooks:
69
- id: pylint
710
name: pylint
8-
entry: pylint
11+
entry: scripts/run-in-env.sh pylint
912
language: system
1013
types: [python]
11-
args:
12-
[
13-
"-rn", # Only display messages
14-
"-sn", # Don't display the score
15-
]
14+
args: [
15+
"-rn", # Only display messages
16+
"-sn", # Don't display the score
17+
]
1618
- repo: https://github.com/PyCQA/isort
1719
rev: 5.10.1
1820
hooks:
@@ -26,12 +28,12 @@ repos:
2628
args:
2729
- --branch=main
2830
- repo: https://github.com/asottile/pyupgrade
29-
rev: v2.30.1
31+
rev: v2.31.0
3032
hooks:
3133
- id: pyupgrade
3234
args: [--py37-plus]
3335
- repo: https://github.com/psf/black
34-
rev: 21.12b0
36+
rev: 22.1.0
3537
hooks:
3638
- id: black
3739
args:
@@ -56,7 +58,7 @@ repos:
5658
- pydocstyle==5.1.1
5759
files: ^(plugwise|tests)/.+\.py$
5860
- repo: https://github.com/PyCQA/bandit
59-
rev: 1.7.1
61+
rev: 1.7.2
6062
hooks:
6163
- id: bandit
6264
args:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
# v0.16.2 - Generic and Stretch
4+
- As per Core deprecation of python 3.8, removed CI/CD testing and bumped pypi to 3.9 and production
5+
- Add support for Stretch with fw 2.7.18
6+
37
# v0.16.1 - Smile - various updates:
48
- BREAKING: Change active device detection, detect both OpenTherm (replace Auxiliary) and OnOff (new) heating and cooling devices.
59
- Stretch: base detection on the always present Stick

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @laetificat, 2019-2020 @CoMPaTech & @bouwew
3+
Copyright (c) 2019 @laetificat, 2019-2020 @CoMPaTech & @bouwew, 2020-current @CoMPaTech, @bouwew & @brefra
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.16.1"
3+
__version__ = "0.16.2"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import Stick

plugwise/nodes/circle_plus.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ def _process_scan_response(self, message):
5757
"Linked plugwise node with mac %s found",
5858
message.node_mac.value.decode(UTF8_DECODE),
5959
)
60-
if (
61-
message.node_mac.value.decode(UTF8_DECODE)
62-
not in self._plugwise_nodes.keys()
63-
):
60+
# TODO: 20220206 is there 'mac' in the dict? Otherwise it can be rewritten to just if message... in
61+
if not self._plugwise_nodes.get(message.node_mac.value.decode(UTF8_DECODE)):
6462
self._plugwise_nodes[
6563
message.node_mac.value.decode(UTF8_DECODE)
6664
] = message.node_address.value

plugwise/stick.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ def scan_timeout_expired(self):
316316
"""Timeout for initial scan."""
317317
if not self.msg_controller.discovery_finished:
318318
for mac in self._nodes_to_discover:
319-
if mac not in self._device_nodes.keys():
319+
# TODO: 20220206 is there 'mac' in the dict? Otherwise it can be rewritten as below (twice as fast above .get)
320+
# if mac not in self._device_nodes:
321+
if not self._device_nodes.get(mac):
320322
_LOGGER.info(
321323
"Failed to discover node type for registered MAC '%s'. This is expected for battery powered nodes, they will be discovered at their first awake",
322324
str(mac),

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.black]
2-
target-version = ["py37", "py38"]
2+
target-version = ["py39", "py310"]
33
exclude = 'generated'
44

55
[tool.isort]

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 3.8)
4+
pyversions=(3.10 3.9)
55
my_path=$(git rev-parse --show-toplevel)
66
my_venv=${my_path}/venv
77

0 commit comments

Comments
 (0)