Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.66k stars 150 forks source link

Add anyio support #97

Closed uSpike closed 2 years ago

uSpike commented 3 years ago

This would fix #96

Adds support for other async frameworks using anyio. The only thing to wait on is the release of anyio version 3, but I'd like to know if there's interest in this!

Cheers.

Tinche commented 3 years ago

I wouldn't mind having this in tbh!

uSpike commented 3 years ago

Anyio 3.0 is out, and this PR is rebased and ready for review @Tinche

uSpike commented 3 years ago

Of note, I had to increase the minimum python version to 3.6.2 to match anyio requirements.

uSpike commented 3 years ago

Actually, upon further inspection some tests are failing after that rebase. Will investigate.

uSpike commented 3 years ago

Frankly, the loop keyword argument for various functions should be deprecated or removed. It was deprecated in python 3.8 and removed in 3.10.

uSpike commented 3 years ago

OK, should be good now. The entirety of /src/aiofiles/tempfile/__init__.py was rewritten with correct line-endings. It was added with Windows style line endings, so I changed it with dos2unix to match the other files.

Tinche commented 3 years ago

I opened an issue over at https://github.com/agronholm/anyio/issues/266 asking for clarification since I see anyio already has async file IO support.

Tinche commented 2 years ago

Looks like anyio has no actual interest in this, so I'm going to pass. Sorry!

uSpike commented 2 years ago

@Tinche i'm confused, you were looking to integrate aiofiles into anyio? That was not my intention here. With this PR you could enable users of asyncio and Trio to use aiofiles. Why close it?