Add minimum versions for dependencies#99
Merged
puddly merged 2 commits intoJun 8, 2026
Conversation
- typing-extensions>=4.13.0: required for TypedDict(extra_items=...) (PEP 728) used by ConnectKwargs in common.py; also covers typing_extensions.Buffer - async-timeout>=3.0.0: only the bare context manager is used, but <=2.0.0 call asyncio.Task.current_task() (removed in 3.9) and crash on the 3.10 install path; also tighten marker to python_version < '3.11' to match the import guard (3.11+ uses asyncio.timeout from the stdlib) - setuptools-rust>=1.7.0: ext-modules are declared in pyproject.toml via [[tool.setuptools-rust.ext-modules]], which requires 1.7.0+
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #99 +/- ##
=======================================
Coverage 92.23% 92.23%
=======================================
Files 22 22
Lines 3632 3632
=======================================
Hits 3350 3350
Misses 282 282 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
Thanks |
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.
Proposed change
This PR specifies the minimum required version for several dependencies in
pyproject.toml:typing-extensions>=4.13.0: required forTypedDict(extra_items=...)(PEP 728) used byConnectKwargsincommon.py; also coverstyping_extensions.Bufferasync-timeout>=3.0.0: only the bare context manager is used, but<=2.0.0callasyncio.Task.current_task()(removed in 3.9) and crash on the 3.10 install path; also tighten marker topython_version < '3.11'to match the import guard (3.11+ usesasyncio.timeoutfrom thestdlib)setuptools-rust>=1.7.0: ext-modules are declared inpyproject.tomlvia[[tool.setuptools-rust.ext-modules]], which requires 1.7.0+Additional information
I installed zigpy into an older venv and noticed that Serialx had an issue with the installed version of
typing-extensionsbeing too old forextra_items, so this PR sets a minimum version where it's actually availabe.Whilst doing that, it was also noticed that the Python version cap in
pyproject.tomlforasync-timeoutinstalls it on Python 3.12, even though it's no longer needed there. It's also not used:serialx/serialx/platforms/serial_socket.py
Lines 15 to 18 in f9f1bf2
A minimum version was also added there for consistency – anything 2.0.0 and below breaks. 2.0.1 does seem to work, but I think it's fine to require 3.0.0 that was released two months later in 2018. (4.0.0 and newer is very much recommended anyways due to significant rewrites apparently.)
A minimum version for
setuptools-rustwas also set to make sure support fortool.setuptools-rustis available.Note: Prek reformatted
pyproject.tomldue to line length.uv.lockwas regenerated without updating the dependencies, only fixing the version constraints.Of course, any of these changes can be removed if they're deemed unnecessary.
AI summary
Verbose AI summary (click to expand)
Summary
Several dependencies in
pyproject.tomlwere unpinned even though the code relies on features that are only available above a certain version. This adds the minimum-version floors that the source actually requires, plus tightens one environment marker that was installing a dependency where it's never used.Changes
Runtime dependencies
typing-extensions>=4.13.0—ConnectKwargsincommon.pydefines aTypedDictwithextra_items=Any(PEP 728), which is only supported since typing-extensions 4.13.0. This is the newest feature used and the binding constraint; the codebase also relies ontyping_extensions.Buffer(PEP 688, 4.6.0+) andSelf/Unpack/NotRequired, all of which 4.13.0 covers.async-timeout>=3.0.0and marker tightened topython_version < '3.11'—async_timeout.timeoutis only imported on the Python 3.10 path; the import guard isif sys.version_info >= (3, 11): from asyncio import timeout … else: from async_timeout import timeout. The previous marker (python_version < '3.12') installedasync-timeouton Python 3.11 too, where it is never imported. The new marker matches the actual import guard. The floor matters: versions ≤ 2.0.0 raiseAttributeErroron Python 3.10 because they call theasyncio.Task.current_task()API that was removed in Python 3.9; 2.0.1 added the compat shim.>=3.0.0is a clean floor above that hard minimum (only the bareasync with timeout(...)context manager is used, so no newer API is required).Build dependencies
setuptools-rust>=1.7.0—setup.pyis a baresetuptools.setup()stub, and the Rust extension is declared entirely via[[tool.setuptools-rust.ext-modules]]inpyproject.toml. Declaring ext-modules inpyproject.toml(instead of passingRustExtension(...)insetup.py) is only supported since setuptools-rust 1.7.0.Lockfile
uv.lockto reflect the updated specifiers. No resolved versions changed — the already-locked versions (typing-extensions 4.15.0, async-timeout 5.0.1) satisfy the new floors.setuptools-rustis a build-only requirement and is correctly absent from the locked runtime graph.