Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hip/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from ._body import GZipStream, HTTPStream
from ._content import Content
from ._headers import Headers
from ._network import Lock, NetworkBackend
from ._parsers import HTTPParser
from ._request import Method, Request
from ._response import Response, StatusCode
from ._streams import Stream
from ._urls import URL
from .backends.sync import Lock, NetworkBackend

__all__ = [
"Connection",
Expand Down
2 changes: 1 addition & 1 deletion src/hip/_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from typing_extensions import Self

from ._connection import Connection, ResponseStream, Transport, open_connection
from ._network import NetworkBackend, Semaphore
from ._request import Request
from ._urls import URL
from .backends.sync import NetworkBackend, Semaphore

__all__ = [
"ConnectionPool",
Expand Down
2 changes: 1 addition & 1 deletion src/hip/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from ._body import HTTPStream
from ._content import Text
from ._headers import Headers
from ._network import NetworkBackend
from ._parsers import HTTPParser
from ._request import Request
from ._response import Response
from ._timeouts import sleep
from .backends.sync import NetworkBackend

__all__ = ["Server"]

Expand Down
6 changes: 0 additions & 6 deletions src/hip/backends.py

This file was deleted.

3 changes: 3 additions & 0 deletions src/hip/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .sync import NetworkBackend, NetworkStream

__all__ = ["NetworkBackend", "NetworkStream"]
4 changes: 2 additions & 2 deletions src/hip/_network.py → src/hip/backends/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# Once we drop 3.10 support, we can use 'typing.Self'.
from typing_extensions import Self

from ._streams import Stream
from ._timeouts import get_current_timeout
from .._streams import Stream
from .._timeouts import get_current_timeout

__all__ = ["NetworkBackend", "NetworkStream"]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_connection(address, timeout):
create_connection_args.append((address, timeout))
return raw_socket

monkeypatch.setattr("hip._network.socket.create_connection", create_connection)
monkeypatch.setattr("hip.backends.sync.socket.create_connection", create_connection)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reminder to self...


stream = backend.connect_tls("example.com", 443)
try:
Expand Down
Loading