Skip to content

Commit

Permalink
python compat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyIvan359 committed Sep 14, 2022
1 parent bef6ee6 commit be2b1e7
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
python-version: [3.6]
python-version: [3.7]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:

strategy:
matrix:
python-version: [3.6]
python-version: [3.7]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Development

* **Changed**
* Bump minimum Python version to 3.7.

* **Added**
* I2C Add interrupt support to MCP230xx devices. Supports interrupts via polling device rapidly or using interrupt pin and a GPIO pin on the host device.
[[#130](https://github.com/CrazyIvan359/mqttany/pull/130)]
Expand All @@ -17,6 +20,7 @@
[[#131](https://github.com/CrazyIvan359/mqttany/pull/131)]
* OneWire DS18x20 devices unable to read data due to incorrect data processing causing read operation to crash. Fixes [#136](https://github.com/CrazyIvan359/mqttany/issues/136).
[[#137](https://github.com/CrazyIvan359/mqttany/pull137)]
* Compatibility fixes for newer versions of Python. Fixes [#142](https://github.com/CrazyIvan359/mqttany/issues/142).

## 0.14.3

Expand Down
6 changes: 3 additions & 3 deletions mqttany/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"update_dict",
]

import collections
from collections.abc import MutableMapping, Mapping
import re
import signal
import typing as t
Expand Down Expand Up @@ -362,9 +362,9 @@ def update_dict(
"""
for k in u:
dv = d.get(k, {})
if not isinstance(dv, collections.MutableMapping): # type: ignore
if not isinstance(dv, MutableMapping): # type: ignore
d[k] = u[k]
elif isinstance(u[k], collections.Mapping): # type: ignore
elif isinstance(u[k], Mapping): # type: ignore
d[k] = update_dict(dv, u[k])
else:
d[k] = u[k]
Expand Down
2 changes: 1 addition & 1 deletion mqttany/gpio/boards/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def lock(
]
)

if not self._lock.value:
if not self._lock.value: # type: ignore
self._lock.raw = module.encode() # type: ignore
if log:
log.debug(
Expand Down
5 changes: 3 additions & 2 deletions mqttany/pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"stubPath": "./../typings",
"pythonVersion": "3.6",
"pythonVersion": "3.7",
"pythonPlatform": "Linux",
"typeCheckingMode": "strict",
"reportImportCycles": "none",
"reportMissingTypeStubs": "warning",
"reportUnusedImport": "warning",
"reportUnusedVariable": "warning",
"reportGeneralTypeIssues": "warning"
"reportGeneralTypeIssues": "warning",
"reportTypeCommentUsage": "none"
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
target-version = ['py36', 'py37', 'py38']
target-version = ['py37', 'py38', 'py39', 'py310']
exclude = '''
/(
\.github
Expand Down
5 changes: 3 additions & 2 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"include": [
"./mqttany"
],
"pythonVersion": "3.6",
"pythonVersion": "3.7",
"pythonPlatform": "Linux",
"typeCheckingMode": "strict",
"reportImportCycles": "none",
"reportMissingTypeStubs": "warning",
"reportUnusedImport": "warning",
"reportUnusedVariable": "warning",
"reportGeneralTypeIssues": "warning"
"reportGeneralTypeIssues": "warning",
"reportTypeCommentUsage": "none"
}

0 comments on commit be2b1e7

Please sign in to comment.