[19.0][FIX] test-requirements: pin anyio<4.15 to unblock CI - #636
[19.0][FIX] test-requirements: pin anyio<4.15 to unblock CI#636TheClaud99 wants to merge 1 commit into
Conversation
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.
|
Upstream status: the fix was merged in Kludex/starlette#3498, which closed So the pin is still needed today, but it now has a clear expiry date. I'll |
lmignon
left a comment
There was a problem hiding this comment.
If it's the only affected version, i would prefer to only exclude one specific version.
| httpx2 | ||
| # starlette.testclient still uses the anyio.abc.BlockingPortal alias, which | ||
| # anyio 4.15 deprecates: the resulting DeprecationWarning fails checklog-odoo. | ||
| anyio<4.15 |
There was a problem hiding this comment.
| anyio<4.15 | |
| anyio!=4.15 |
There was a problem hiding this comment.
Nevertheless thank you for the fix 😏
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@TheClaud99 Let me try something to simply ignore this warning...
|
@TheClaud99 @simahawk see #639 to avoid to pin and lock to a specific version of anyio when it's not required by the api... |
|
Closing in favour of #639, now merged. Thanks both. |
Problem
checklog-odoo(OCA_ENABLE_CHECKLOG_ODOO: "1") treats this record as anerror, failing the job after the addon tests have completed:
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, turnedanyio.abc.BlockingPortalinto a deprecated alias._PortalFactoryTypeinstarlette/testclient.pyis evaluated at import time, so merely importingstarlette.testclientemits the warning.Timeline, since the branches still show green:
19.0: Aug 1118.0: Sep 1This 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.15intest-requirements.txt. This only constrains the testenvironment. 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.0and18.0have the same import and need the same change; I canopen the equivalent PRs on those branches on request.