Skip to content

anyio/Trio compatibility#134

Open
smurfix wants to merge 5 commits into
opsani:mainfrom
smurfix:main
Open

anyio/Trio compatibility#134
smurfix wants to merge 5 commits into
opsani:mainfrom
smurfix:main

Conversation

@smurfix

@smurfix smurfix commented Dec 14, 2023

Copy link
Copy Markdown

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

smurfix commented Dec 14, 2023

Copy link
Copy Markdown
Author

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
Copy Markdown
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

smurfix commented Dec 16, 2023

Copy link
Copy Markdown
Author

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