Repository navigation
chore(deps): allow pycryptodome 4 - #1076
Merged
Merged
Conversation
Lash-L
reviewed
Nov 22, 2026
Lash-L
left a comment
Collaborator
There was a problem hiding this comment.
Automated code review by Gemini 4 Neon in Antigravity using our /review (/code-review) skill (.agents/skills/code-review/SKILL.md / AGENTS.md).
Summary
Reviewed commit d031f09 (pyproject.toml, uv.lock). No findings — this PR is clean and ready to approve once CI runs and passes.
Verification
- Scope & Packaging: Loosens
pycryptodomefrom~=3.18to>=3.18,<5inpyproject.tomland updates the correspondingrequires-distspecifier inuv.locksouv-sync --lockedstays in sync.requires-python = ">=3.11, <4"satisfiespycryptodome 4.0.0(>=3.9). - Priority 3 — Cryptography Compatibility: Audited all
Cryptoimports acrossroborock/(broadcast_protocol.py,protocol.py,protocols/a01_protocol.py,protocols/b01_q7_protocol.py) andtests/. Every usage is limited toCrypto.Cipher.AES(ECB, CBC, GCM,block_size) andCrypto.Util.Padding(pad,unpad) with zeroCryptodomeimports. None ofpycryptodome 4.0.0's breaking changes (dropping Python 2.7/3.8, retiringpycryptodomex, RSA/DSA OpenSSHexport_key(), ECC/ElGamal/KDF/HMAC/PBKDF2 changes) affect these APIs. - macOS
pycryptodomexLine: Leavingpycryptodomex~=3.18 ; sys_platform == 'darwin'untouched is properly scoped and does not conflict withpycryptodome 4.x(CryptodomevsCryptonamespaces). - CI / Lockfile Note (Non-blocking): GitHub Actions checks have not yet run on this PR, and
uv.lockremains resolved topycryptodome 3.23.0(which keeps the diff minimal; CI will validate against3.23.0unless the lockfile is upgraded to4.0.0here or in a follow-up Dependabot PR).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pyproject.tomlpinspycryptodome~=3.18, which caps it at<4. pycryptodome 4.0.0 was released on 14 Oct, sopython-roborock(and Home Assistant setups that load it) can't be installed next to packages that require it.python-roborock uses
AES(ECB/CBC/GCM) andCrypto.Util.Paddingfor the device protocols. pycryptodome 4.0's breaking changes don't touch those: they drop Python 2.7/3.8, stop releasingpycryptodomex, change ECC/ElGamal/KDF/RSA-size handling, and deprecate theHMAC/PBKDF2defaults. This changes the requirement topycryptodome>=3.18,<5. I left the macOSpycryptodomex~=3.18line as is, sincepycryptodomex4.x won't be released.uv.lockchanges only in therequires-distspecifier (uv lock --checkpasses).Tests on Python 3.12: the 47 test files that cover encryption, decryption and the protocol encoders/decoders gave identical results with pycryptodome 3.23.0 and 4.0.0 (1408 passed, 47 xfailed; the same 5 errors on both on my Windows machine). I left out the MQTT-session and local-channel tests, which hang on my machine regardless of the pycryptodome version.