Repository navigation
Python 3.13 and 3.14 support (re-lands #88), and a 6x faster import - #90
Merged
Merged
Conversation
Extend the CI build matrix and PyPI trove classifiers to cover Python 3.13 and 3.14. Two runtime issues surfaced on the new versions and are fixed here: - Python 3.13+ enforces that an object returned by __iter__ must itself be a proper iterator (i.e. define __iter__). AbstractIterator and AbstractAsyncIterator only defined __next__/__anext__, so iterating a ResourceSet raised 'ResourceIterator object is not iterable'. Add __iter__/__aiter__ returning self. - httpcore 1.0.6 crashed at import on Python 3.14 (setting __module__ on typing.Union). Bump httpcore 1.0.6 -> 1.0.9 (and h11 0.14 -> 0.16) in the lock file; both are transitive deps, so no pyproject change needed. All 407 tests pass on 3.12, 3.13 and 3.14. (cherry picked from commit 6353e58)
help_formatter imported inflect at module level, and inflect takes most of a second to import. So every `import connect.client` paid it, and with it every extension, report and CLI command, although only the help of a resource uses it: on Python 3.13, `import connect.client` took 1,165 ms. It now takes 196 ms. A test checks that importing the client leaves inflect unimported.
The test matrix now includes Python 3.14, where flake8 could not run: - flake8-future-import uses ast.Str, which Python 3.14 removed. It goes: its last release is from 2022, its FI1 codes are on the ignore list, and code that requires Python 3.10 needs no __future__ imports. - flake8-bugbear was capped below 23, and those releases crash on Python 3.14's syntax tree. It now requires 24 or newer, as in connect-cli. The newer bugbear flags one test that expected any Exception (B017). It now matches the error the test raises. No other locked version changes.
This was referenced Nov 1, 2026
Loading inflect lazily added a branch to format_resource and took its cognitive complexity to 16, one over Sonar's limit of 15. The lazy load moves into a small _singular helper. Behaviour is unchanged.
Sonar (python:S5778) flagged four exception tests that also ran their setup inside pytest.raises, so a setup error of the same type would have passed them. The setup now runs first. The test whose mocked request is meant not to match starts and resets the mocker itself, so the unused mock isn't reported.
|
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.



What
__iter__/__aiter__on the iterators, and httpcore 1.0.9 / h11 0.16 in the lock. LITE-33583: Add Python 3.13 and 3.14 to the test matrix #88 was merged into the branch of LITE-33583: Runtime floor to Python 3.10 and modernize http toolchain #86 after LITE-33583: Runtime floor to Python 3.10 and modernize http toolchain #86 had already reached master, so none of it is on master. Pablo's commit is cherry-picked unchanged.inflectis imported only when a resource's help needs it.Exceptionnow matches its error (B017).Why
ResourceSetraisesTypeError: 'ResourceIterator' object is not iterable. The existing iteration tests fail there, and so does connect-cli.import connect.clienttook 1.2 s, almost all of itinflect, and every extension, report and CLI command pays it.Key decisions
How it worked before / after
import connect.client(3.13, M1 Pro)Locally, lint is clean and 410 tests pass on Python 3.10, 3.13 and 3.14.