Skip to content

Remove async_timeout and update python versions#94

Open
xavierforestier wants to merge 6 commits into
cgtobi:developmentfrom
xavierforestier:development
Open

Remove async_timeout and update python versions#94
xavierforestier wants to merge 6 commits into
cgtobi:developmentfrom
xavierforestier:development

Conversation

@xavierforestier

@xavierforestier xavierforestier commented Jun 7, 2026

Copy link
Copy Markdown

Summary by Sourcery

Update async timeout handling and modernize supported Python versions.

Enhancements:

  • Replace async_timeout usage with asyncio.timeout in RMV API query logic to rely on the standard library.
  • Tidy test helper date parsing loops and logging setup for minor style consistency.

CI:

  • Update GitHub Actions test matrix to run against Python 3.11 through 3.14 instead of 3.8 through 3.10.

@sourcery-ai

sourcery-ai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces async_timeout with asyncio.timeout in the RMV API client, updates the GitHub Actions test matrix to newer Python versions, and applies minor Python style cleanups in tests.

Sequence diagram for RMV API query using asyncio.timeout

sequenceDiagram
    participant RMVClient
    participant asyncio
    participant HttpxAsyncClient as httpx.AsyncClient
    participant RMV_API

    RMVClient->>asyncio: timeout(self._timeout)
    activate asyncio
    asyncio->>HttpxAsyncClient: __aenter__()
    activate HttpxAsyncClient
    HttpxAsyncClient->>RMV_API: get(url)
    RMV_API-->>HttpxAsyncClient: response
    HttpxAsyncClient-->>RMVClient: response
    deactivate HttpxAsyncClient
    asyncio-->>RMVClient: __aexit__()
    deactivate asyncio
Loading

File-Level Changes

Change Details Files
Replace async_timeout with built-in asyncio.timeout for HTTP requests to the RMV API.
  • Update the async RMV API query helper to use asyncio.timeout instead of async_timeout.timeout around the httpx.AsyncClient request block
  • Rely on asyncio’s built-in timeout context, removing the external async_timeout dependency implicitly
RMVtransport/rmvtransport.py
Update CI to test against newer Python versions.
  • Adjust GitHub Actions workflow matrix to run tests on Python 3.11 through 3.14 instead of 3.8 through 3.10
.github/workflows/pythonpackage.yml
Apply minor Python style/modernization tweaks in tests.
  • Remove unnecessary parentheses in for-loop unpacking in JSON date_hook helpers in tests and common utilities
  • Keep logging configuration and date parsing logic otherwise unchanged
tests/test_bugs.py
tests/common.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since the workflow now only tests 3.11–3.14 and uses asyncio.timeout, make sure your packaging metadata (e.g., pyproject.toml/setup.cfg classifiers and requires-python) is updated to reflect the new minimum Python version.
  • Now that async_timeout has been replaced with asyncio.timeout, remove any remaining async-timeout dependency declarations from your dependency files so they stay in sync with the code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the workflow now only tests 3.11–3.14 and uses asyncio.timeout, make sure your packaging metadata (e.g., pyproject.toml/setup.cfg classifiers and requires-python) is updated to reflect the new minimum Python version.
- Now that async_timeout has been replaced with asyncio.timeout, remove any remaining async-timeout dependency declarations from your dependency files so they stay in sync with the code.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Xavier and others added 2 commits June 7, 2026 09:48
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.

1 participant