Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update aiotools (1.7.0 -> 1.8.2) for Python 3.13 support #3520

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

achimnol
Copy link
Member

@achimnol achimnol commented Jan 22, 2025

resolves #3500 (BA-538)

aiotools release notes

Typing fixes

  • Use asyncio.Future instead of asyncio.Task to type the return value of aiotools.PersistentTaskGroup.create_task().
  • Update our PersistentTaskGroup exception handlers to follow the new aiotools.AsyncExceptionHandler typing (ExceptionBaseException).
  • Use @aiotools.server_context instead of hacky module-callable @aiotools.server to satisfy mypy.
  • Use intrinsic generics (list[...], dict[...], tuple[...]) and collections.abc generics for updated source files.

Typing fixes newly found by mypy in the affected source files

  • Use typing.Self as the return type of the class builder method in common.events.AbstractEvent to resolve type mismatch of overridden methods.
  • Fix inconsistent result typing of common.redis_helper.read_stream().
  • Use explicit .decode() in string interpolation braces that refer bytes as mypy began to complain about potential mis-prints like b"xxx" instead of "xxx".
  • Replace aiotools.aclosing with contextlib.aclosing (added in Python 3.10).

Tip

To run mypy with a local editable source of aiotools:

$ pants export --resolve=python-default
$ ./py -m pip install -e path/to/aiotools/working-copy
$ LOCKSET=mypy/3.12.8 python -m mypy src tests

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue

@achimnol achimnol added this to the 25Q1 milestone Jan 22, 2025
@achimnol achimnol added the area:upstream Issues with root cause from upstream 3rd parties label Jan 22, 2025
@achimnol achimnol self-assigned this Jan 22, 2025
@achimnol achimnol added the skip:changelog Make the action workflow to skip towncrier check label Jan 22, 2025
@github-actions github-actions bot added the size:XS ~10 LoC label Jan 22, 2025
…er_context`

- "callable module" is a hack and currently not officially supported.
@github-actions github-actions bot added comp:manager Related to Manager component comp:agent Related to Agent component comp:webserver Related to Web Server component size:L 100~500 LoC and removed size:XS ~10 LoC labels Jan 22, 2025
@achimnol achimnol changed the title chore: Update aiotools (1.7.0 -> 1.8.0) for Python 3.13 support chore: Update aiotools (1.7.0 -> 1.8.1) for Python 3.13 support Jan 22, 2025
@achimnol achimnol changed the title chore: Update aiotools (1.7.0 -> 1.8.1) for Python 3.13 support chore: Update aiotools (1.7.0 -> 1.8.2) for Python 3.13 support Jan 23, 2025
- Introduce typing.Self to AbstractEvent to resolve return-type-mismatch
  errors.
- Fix inconsistent result typing of redis_helper.read_stream() and
  read_stream_by_group().
@github-actions github-actions bot added the comp:common Related to Common component label Jan 24, 2025
@achimnol achimnol requested a review from HyeockJinKim January 24, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:upstream Issues with root cause from upstream 3rd parties comp:agent Related to Agent component comp:common Related to Common component comp:manager Related to Manager component comp:webserver Related to Web Server component size:L 100~500 LoC skip:changelog Make the action workflow to skip towncrier check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update aiotools to support Python 3.13
1 participant