diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index e0c505c..f106fa4 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - python-version: [3.6] + python-version: [3.7] steps: - uses: actions/checkout@v2 @@ -51,7 +51,7 @@ jobs: strategy: matrix: - python-version: [3.6] + python-version: [3.7] steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b7aa80..7e34c69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)] @@ -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 diff --git a/mqttany/common.py b/mqttany/common.py index 8d53b70..2bffc89 100644 --- a/mqttany/common.py +++ b/mqttany/common.py @@ -39,7 +39,7 @@ "update_dict", ] -import collections +from collections.abc import MutableMapping, Mapping import re import signal import typing as t @@ -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] diff --git a/mqttany/gpio/boards/base.py b/mqttany/gpio/boards/base.py index d7f3113..32206b3 100644 --- a/mqttany/gpio/boards/base.py +++ b/mqttany/gpio/boards/base.py @@ -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( diff --git a/mqttany/pyrightconfig.json b/mqttany/pyrightconfig.json index e7619ce..ce962ff 100644 --- a/mqttany/pyrightconfig.json +++ b/mqttany/pyrightconfig.json @@ -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" } diff --git a/pyproject.toml b/pyproject.toml index 6006606..908207a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target-version = ['py36', 'py37', 'py38'] +target-version = ['py37', 'py38', 'py39', 'py310'] exclude = ''' /( \.github diff --git a/pyrightconfig.json b/pyrightconfig.json index f4bf9c2..7ea3797 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -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" }