Skip to content

fix: annotate context managers with Generator for ty 0.0.85 - #160

Merged
lesnik512 merged 1 commit into
mainfrom
fix/ty-0-0-85
Oct 7, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/ty-0-0-85

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Closes #159

ty 0.0.85 bundles a typeshed that deprecates the contextmanager / asynccontextmanager overloads for functions annotated -> Iterator[T] / -> AsyncIterator[T], so ty check in the scheduled run reported 9 warnings and failed. The context managers are now annotated -> Generator[T] / -> AsyncGenerator[T].

The types come from collections.abc, not typing: before 3.13, typing.Generator needs all three type arguments.

Changes

  • src/httpware/_internal/exception_mapping.py: Generator / AsyncGenerator return types on the two exception mappers.
  • src/httpware/client.py: same for _stream, _stream_capped, their async versions, and both stream() methods.
  • tests/test_client_dispatch.py: same for _decode_spies.

Checklist

  • just lint-ci passes with ty 0.0.85 (failed with 9 warnings before the change)
  • just test passes (1007 tests)

@lesnik512
lesnik512 merged commit ffbacb0 into main Oct 7, 2026
13 checks passed
@lesnik512
lesnik512 deleted the fix/ty-0-0-85 branch October 7, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduled dependency check failed

1 participant