-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bump anyio dependency to latest major version #42
Comments
Hi, There's no blocker against this, I would be happy to help get a PR reviewed and merged to add anyio 4 support :) Let's try to target anyio >= 3.2 if we can? |
Thanks for the quick reply! I tried running the testing suite with
The test asserts that if one of the tasks started in If we retain support for |
Is the ExceptionGroup raised on all Python versions, or only most recent ones? Does the ExceptionGroup contain only the exception raised by user code? I assume not. Then what's the other exception? If there's only the user exception, would it make sense to unwrap the exception group so we keep the current behaviour? Or should we embrace the new exception group stuff? I must say I haven't really kept on top of that and I'm not sure we can assume users will be comfortable handling exception groups either, so in that case we probably need some extra pointers in the docs. One thing we can sure of is we don't want any anyio specific APIs to leak through. |
I tried on Python 3.8 and 3.11 and the behaviour is the same, the only difference is that on 3.8 we get an ExceptionGroup backport from It really is just one exception in the group. The In fact,
Looking at the implementation, I think this is because there are two nested task groups - one in
I'm not sure, but I'm leaning towards no. I don't think that's something that should happen in |
Thanks for the input and bouncing off of ideas. It's interesting that the anyio migration guide suggests to do this kind of unwrapping "If you need to stay compatible with both AnyIO 3 and 4". I just opened #43 as an attempt of that. |
@kwzrd #43 is passing. Happy to read your thoughts on this approach? This would lead to a non-breaking release of aiometer, as 0.5.0. We could add ExceptionGroup support to aiometer in the future, so that it's possible to really get all exceptions that might happen concurrently as tasks execute. But I think it's okay treat that as a follow-up enhancement, with its own proper compatibility and upgrade approach, rather than a blocker for anyio 4 support, since we don't have it now anyways. I understand you were interested in ExceptionGroup support so once we get anyio 4 unblocked, I'd be happy to read your input on how to add support for that in aiometer, and how you'd use it in practice (possibly with some motivating example code?). |
Looks great! Yeah, this approach makes sense to me.
I think this solves my use case already. I primarily just want to be able to use The general problem was that we use Python task groups as well as |
Right, the compat code only unwraps single exception groups. 👍 |
Hi, are there any plans to bump the
anyio
dependency to4.x.y
?There was a fairly important change in version
4.0.0
whereanyio
now raises the Python-nativeExceptionGroup
rather than its own. This means thatanyio
users can now handle exceptions withexcept*
.I love using
aiometer
but being pinned toanyio~=3.2
prevents me from using the new Python-native exception group error handling.Thanks!
The text was updated successfully, but these errors were encountered: