-
Notifications
You must be signed in to change notification settings - Fork 419
Add Windows support #31
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
Comments
This is because asyncpg is not supported on windows. I've got a separate branch here https://github.com/espositofulvio/asyncpg/tree/windows which allows me to compile the extension and run a simple test import asyncio
import asyncpg
async def init_app():
connection = await asyncpg.connect(host='127.0.0.1', database='postgres', user='postgres', password='postgres' )
async with connection.transaction():
res = await connection.fetchval( 'select 2 ^ 5' )
print( 'result is {0}'.format( res ) )
loop = asyncio.get_event_loop()
app = loop.run_until_complete(init_app()) But 99 tests out of 103 fail with the error "cluster is not running". I'm not sure what Cluster represents as I can find usages only in tests. Maybe someone from the core team can explain so I can try and make all tests pass on Windows as well. |
There are some issues with starting the Postgres cluster on Windows that fails the tests. I haven't really looked into what exactly is wrong, but you can probably get that by putting |
I've also got to conditionally add the local entry in pg_hba.conf because it doesn't work on windows and add an entry for "::1/128" as well. ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host Any hunch what might cause that? |
This is the first error from tests:
|
@espositofulvio @amigo00678 I have the same problem with asyncpg on Windows. Did you figure out how to solve this issue? |
@Nursik91 unfortunately not yet. It's not very clear to me, I had a look at a couple of cases and I couldn't find a reason as to why that exceptions are thrown. It looks like await is not called on the future but I can actually see it in the test case, so I'm dead in the water. If you want to try it by yourself, have a look at https://github.com/espositofulvio/asyncpg/tree/windows where I'm developing windows support. I'm using cmder as shell, but make is not supported so I had to type each build command to compile the extension, you need VisualC++ 2015 installed by the way. By the way, I've also tried switching to a ProactorLoopEvent as it is suggested for higher performance, but then there are loads of exceptions so I won't recommend using asyncpg in production on Windows until uvloop by MagickStack is ported to Windows as well. |
@elprans by the way, is there an internal effort at MagickStack to support Windows? I mean for uvloop and asyncpg mainly. |
@espositofulvio I will try to look into asyncpg Windows issues this week. |
Closing this issue now. |
Running 'python -m pip install asyncpg' causes an error on Windows:
`
running build_ext
building 'asyncpg.protocol.protocol' extension
creating build\temp.win32-3.5
creating build\temp.win32-3.5\Release
creating build\temp.win32-3.5\Release\asyncpg
creating build\temp.win32-3.5\Release\asyncpg\protocol
creating build\temp.win32-3.5\Release\asyncpg\protocol\record
C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /
W3 /GL /DNDEBUG /MD -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files\Windows Kits\8.1\include\shared" "-IC:\Program Files\Windows Kits\8.1\include\um" "-IC:\Program Files\Windows Kits\8.1\include\winrt" /Tcasyncpg/protocol/record/recordobj.c Fobuild\temp.win32-3.5\Release\asyncpg/protocol/record/recordobj.obj -O2
recordobj.c
C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python35\include -IC:\Python35\include "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files\Windows Kits\8.1\include\shared" "-IC:\Program Files\Windows Kits\8.1\include\um" "-IC:\Program Files\Windows Kits\8.1\include\winrt" /Tcasyncpg/protocol/protocol.c /Fobuild\temp.win32-3.5\Rel
ease\asyncpg/protocol/protocol.obj -O2
protocol.c
asyncpg/protocol/protocol.c(276): fatal error C1083: Cannot open include file: 'arpa/inet.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2
The text was updated successfully, but these errors were encountered: