Skip to content

[19.0][FIX] test-requirements: pin anyio<4.15 to unblock CI - #636

Closed
TheClaud99 wants to merge 1 commit into
OCA:19.0from
TheClaud99:19.0-fix-test-requirements-anyio
Closed

[19.0][FIX] test-requirements: pin anyio<4.15 to unblock CI#636
TheClaud99 wants to merge 1 commit into
OCA:19.0from
TheClaud99:19.0-fix-test-requirements-anyio

Conversation

@TheClaud99

@TheClaud99 TheClaud99 commented Sep 4, 2026

Copy link
Copy Markdown

Problem

checklog-odoo (OCA_ENABLE_CHECKLOG_ODOO: "1") treats this record as an
error, failing the job after the addon tests have completed:

WARNING odoo py.warnings: starlette/testclient.py:53: DeprecationWarning:
The anyio.abc.BlockingPortal alias is deprecated, use anyio.from_thread.BlockingPortal instead.

This causes a red CI on every PR targeting 19.0 (like my PR here: #616)

Root cause

anyio 4.15.0, released after the last run on 19.0, turned
anyio.abc.BlockingPortal into a deprecated alias. _PortalFactoryType in
starlette/testclient.py is evaluated at import time, so merely importing
starlette.testclient emits the warning.

Timeline, since the branches still show green:

  • anyio 4.15.0 published to PyPI: Sep 2
  • last run on 19.0: Aug 11
  • last run on 18.0: Sep 1

This is tracked upstream in Kludex/starlette#3497, with a fix proposed in
Kludex/starlette#3506 (opened Sep 4, not yet merged).
starlette 1.6.0 (latest) still ships the old alias, so no released version
avoids this today.

Fix

Pin anyio<4.15 in test-requirements.txt. This only constrains the test
environment. It can be dropped once a starlette release including
Kludex/starlette#3506 is available, not merely once that PR is merged.

CI on this PR is the verification: same code as 19.0, green with the pin.

Scope

Problably this problem affects every PR on this repo, not just the one where I hit it (#616).
16.0, 17.0 and 18.0 have the same import and need the same change; I can
open the equivalent PRs on those branches on request.

starlette.testclient references the deprecated anyio.abc.BlockingPortal
alias. anyio 4.15 emits a DeprecationWarning for it on import, which
checklog-odoo reports as an error and makes every build fail even though
all tests pass. Pin anyio until starlette uses anyio.from_thread.
@TheClaud99

Copy link
Copy Markdown
Author

Upstream status: the fix was merged in Kludex/starlette#3498, which closed
Kludex/starlette#3497. It is not in a release yet: starlette on PyPI is still
1.6.0 (Aug 8), which ships the deprecated alias.

So the pin is still needed today, but it now has a clear expiry date. I'll
close this PR as soon as a starlette release including #3498 is out, or open
the revert if this has been merged by then.

@simahawk simahawk mentioned this pull request Sep 7, 2026

@simahawk simahawk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@lmignon ping

@lmignon lmignon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it's the only affected version, i would prefer to only exclude one specific version.

Comment thread test-requirements.txt
httpx2
# starlette.testclient still uses the anyio.abc.BlockingPortal alias, which
# anyio 4.15 deprecates: the resulting DeprecationWarning fails checklog-odoo.
anyio<4.15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
anyio<4.15
anyio!=4.15

@lmignon lmignon Sep 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nevertheless thank you for the fix 😏

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good point, but I think the problem isn't a regression in one release because the alias deprecation is intentional.
Version 4.15.1 was released on Sep 5 and behaves the same way (tested the warning in my local environment), so <4.15 is the narrowest thing that works

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@TheClaud99 Let me try something to simply ignore this warning...

@lmignon

lmignon commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@TheClaud99 @simahawk see #639 to avoid to pin and lock to a specific version of anyio when it's not required by the api...

@TheClaud99

Copy link
Copy Markdown
Author

Closing in favour of #639, now merged. Thanks both.

@TheClaud99 TheClaud99 closed this Sep 7, 2026
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.

3 participants