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

anyio/Trio compatibility #134

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

anyio/Trio compatibility #134

wants to merge 5 commits into from

Conversation

smurfix
Copy link

@smurfix smurfix commented Dec 14, 2023

This patch (OK, three of them) adds Trio compatibility, by way of anyio.

It also fixes two minor other issues, in separate patches:

  • don't use iscoroutinefunction. That prevents wrapping async functions with a sync wrapper, which is perfectly legitimate Python code.
  • don't compare to False with "==". Either use "not", if None, zero or the empty string should be considered false, or "is" if they should not be. I opted for the latter approach.

It's perfectly legal to wrap an async function in a sync wrapper.
statesman is now compatible with Trio
@smurfix
Copy link
Author

smurfix commented Dec 14, 2023

I have to admit that I have no idea what I'm doing with the poetry.lock file … reverting that change. Somebody else (who knows their way around poetry …) can remove the dependency on pytest.asyncio; it's no longer needed.

@pnickolov
Copy link
Member

Thank you @smurfix for the PR!
I think all we need to do is let poetry update the lock file with the new dependency. I think we can do it as part of the merge.

@smurfix
Copy link
Author

smurfix commented Dec 16, 2023

Ah, OK, so why do you ship the poetry.lock file in the first place, given that it's autogenerated? IMHO that's generally not a good idea …

The tests fail because it couldn't find anyio 4.1, which is strange because that has been out for some time by now.

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.

2 participants