Skip to content

Commit

Permalink
Fix compatibility with httpcore 0.17.3 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
romis2012 committed Jul 6, 2023
1 parent e7baeed commit 740a8b4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion httpx_socks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'httpx-socks'
__version__ = '0.7.6'
__version__ = '0.7.7'

from python_socks import (
ProxyError,
Expand Down
8 changes: 4 additions & 4 deletions httpx_socks/_async_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
AsyncHTTP11Connection,
ConnectionNotAvailable,
)
from httpcore import AsyncNetworkStream
from httpcore._synchronization import AsyncLock
from httpcore.backends.base import AsyncNetworkStream
from python_socks import ProxyType, parse_proxy_url


Expand Down Expand Up @@ -174,7 +174,7 @@ async def _open_stream(self, host, port, connect_timeout, ssl_context):
raise RuntimeError(f'Unsupported concurrency backend {backend!r}') # pragma: no cover

async def _open_aio_stream(self, host, port, connect_timeout, ssl_context):
from httpcore.backends.asyncio import AsyncIOStream
from httpcore._backends.anyio import AnyIOStream
from python_socks.async_.anyio import Proxy

proxy = Proxy.create(
Expand All @@ -194,10 +194,10 @@ async def _open_aio_stream(self, host, port, connect_timeout, ssl_context):
timeout=connect_timeout,
)

return AsyncIOStream(proxy_stream.anyio_stream)
return AnyIOStream(proxy_stream.anyio_stream)

async def _open_trio_stream(self, host, port, connect_timeout, ssl_context):
from httpcore.backends.trio import TrioStream
from httpcore._backends.trio import TrioStream
from python_socks.async_.trio.v2 import Proxy

proxy = Proxy.create(
Expand Down
2 changes: 1 addition & 1 deletion httpx_socks/_sync_stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ssl
import typing

from httpcore.backends.sync import SyncStream as CoreSyncStream
from httpcore._backends.sync import SyncStream as CoreSyncStream
from httpcore._utils import is_socket_readable
from python_socks.sync.v2._ssl_transport import SSLTransport

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
httpx>=0.21.0,<0.25.0
httpcore>=0.14.0,<0.18.0
httpcore>=0.17.3,<0.18.0
anyio==3.*
python-socks>=2.0.0
async-timeout>=3.0.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
keywords='httpx asyncio socks socks5 socks4 http proxy',
install_requires=[
'httpx>=0.21.0,<0.25.0',
'httpcore>=0.14.0,<0.18.0',
'httpcore>=0.17.3,<0.18.0',
'python-socks>=2.0.0',
],
extras_require={
Expand Down

0 comments on commit 740a8b4

Please sign in to comment.