From aaa9239fe3d3d0a7b539e3f4240d565ce310b4df Mon Sep 17 00:00:00 2001 From: Arkadiusz Bulski Date: Thu, 22 Feb 2018 13:20:04 +0100 Subject: [PATCH 1/3] construct-related, asserts version is equal to that in setup.py --- miio/protocol.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miio/protocol.py b/miio/protocol.py index e39f91eba..fff1d8905 100644 --- a/miio/protocol.py +++ b/miio/protocol.py @@ -21,6 +21,7 @@ from construct import (Struct, Bytes, Const, Int16ub, Int32ub, GreedyBytes, Adapter, Checksum, RawCopy, Rebuild, IfThenElse, Default, Pointer, Hex, Probe) +import construct from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend @@ -28,6 +29,9 @@ _LOGGER = logging.getLogger(__name__) +# needs to be maintained in sync with setup.py and requirements.txt +assert construct.version_string == "2.9.31" + class Utils: """ This class is adapted from the original xpn.py code by gst666 """ From 3df98befa6c6a9b511ba70896e02fc0c61648077 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bulski Date: Thu, 22 Feb 2018 13:22:59 +0100 Subject: [PATCH 2/3] setup.py refactored into lines --- setup.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 2f153ba98..833170477 100644 --- a/setup.py +++ b/setup.py @@ -42,16 +42,19 @@ def readme(): packages=["miio", "mirobo"], python_requires='>=3.4', - install_requires=['construct==2.9.31', - 'click', - 'cryptography', - 'pretty_cron', - 'typing; python_version < "3.5"', - 'zeroconf', - 'attrs', - 'android_backup', - 'pytz', - 'appdirs'], + + install_requires=[ + 'construct==2.9.31', + 'click', + 'cryptography', + 'pretty_cron', + 'typing; python_version < "3.5"', + 'zeroconf', + 'attrs', + 'android_backup', + 'pytz', + 'appdirs', + ], entry_points={ 'console_scripts': [ From c82d558dd03991be3fa13c44a900e38c6dd0b2f7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bulski Date: Thu, 22 Feb 2018 13:26:27 +0100 Subject: [PATCH 3/3] changelog updated, #226 title renamed --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2162585c..3978d15f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ This is a bugfix release which provides improved stability and compatibility. **Merged pull requests:** - Proper handling of the device\_id representation [\#228](https://github.com/rytilahti/python-miio/pull/228) ([syssi](https://github.com/syssi)) -- construct-code uptodate [\#226](https://github.com/rytilahti/python-miio/pull/226) ([arekbulski](https://github.com/arekbulski)) +- Construct related, support upto 2.9.31 [\#226](https://github.com/rytilahti/python-miio/pull/226) ([arekbulski](https://github.com/arekbulski)) ## [0.3.6](https://github.com/rytilahti/python-miio/tree/0.3.6)