8000 Updated dependencies by mjcaley · Pull Request #375 · mjcaley/aiospamc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updated dependencies #375

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

Merged
merged 4 commits into from
Apr 21, 2023
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 .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/python-poetry/poetry
rev: 1.3.0
rev: 1.4.2
hooks:
- id: poetry-check
8 changes: 4 additions & 4 deletions aiospamc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ async def request(
req: Request,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
) -> Response:
"""Sends a request and returns the parsed response.
Expand Down
15 changes: 10 additions & 5 deletions aiospamc/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class Timeout:
"""Container object for defining timeouts."""

def __init__(
self, total: float = 600, connection: float = None, response: float = None
self,
total: float = 600,
connection: Optional[float] = None,
response: Optional[float] = None,
) -> None:
"""Timeout constructor.

Expand All @@ -46,7 +49,9 @@ def __repr__(self):
class ConnectionManager:
"""Stores connection parameters and creates connections."""

def __init__(self, connection_string: str, timeout: Timeout = None) -> None:
def __init__(
self, connection_string: str, timeout: Optional[Timeout] = None
) -> None:
"""ConnectionManager constructor.

:param timeout: Timeout configuration
Expand Down Expand Up @@ -159,8 +164,8 @@ def __init__(
self,
host: str,
port: int,
ssl_context: ssl.SSLContext = None,
timeout: Timeout = None,
ssl_context: Optional[ssl.SSLContext] = None,
timeout: Optional[Timeout] = None,
) -> None:
"""TcpConnectionManager constructor.

Expand Down Expand Up @@ -197,7 +202,7 @@ async def open(self) -> Tuple[asyncio.StreamReader, asyncio.StreamWriter]:
class UnixConnectionManager(ConnectionManager):
"""Connection manager for Unix pipes."""

def __init__(self, path: str, timeout: Timeout = None):
def __init__(self, path: str, timeout: Optional[Timeout] = None):
"""UnixConnectionManager constructor.

:param path: Unix socket path.
Expand Down
64 changes: 32 additions & 32 deletions aiospamc/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ async def check(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -104,10 +104,10 @@ async def headers(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -189,8 +189,8 @@ async def ping(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Optional[Any] = None,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -264,10 +264,10 @@ async def process(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -350,10 +350,10 @@ async def report(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -435,10 +435,10 @@ async def report_if_spam(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -521,10 +521,10 @@ async def symbols(
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down Expand Up @@ -605,15 +605,15 @@ async def symbols(
async def tell(
message: Union[bytes, SupportsBytes],
message_class: Union[str, MessageClassOption],
remove_action: Union[str, ActionOption] = None,
set_action: Union[str, ActionOption] = None,
remove_action: Union[str, ActionOption, None] = None,
set_action: Union[str, ActionOption, None] = None,
*,
host: str = "localhost",
port: int = 783,
socket_path: str = None,
timeout: Timeout = None,
verify: Optional[Any] = None,
user: str = None,
socket_path: Optional[str] = None,
timeout: Optional[Timeout] = None,
verify: Any = None,
user: Optional[str] = None,
compress: bool = False,
**kwargs,
) -> Response:
Expand Down
1 change: 1 addition & 0 deletions aiospamc/header_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import Any, Dict, Optional


@dataclass
class HeaderValue:
"""Base class for header values."""

Expand Down
4 changes: 2 additions & 2 deletions aiospamc/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Contains all requests that can be made to the SPAMD service."""

import zlib
from typing import Any, Dict, SupportsBytes, Union
from typing import Any, Dict, Optional, SupportsBytes, Union

from .header_values import ContentLengthValue, HeaderValue

Expand All @@ -15,7 +15,7 @@ def __init__(
self,
verb: str,
version: str = "1.5",
headers: Dict[str, HeaderValue] = None,
headers: Optional[Dict[str, HeaderValue]] = None,
body: Union[bytes, SupportsBytes] = b"",
**_,
) -> None:
Expand Down
4 changes: 2 additions & 2 deletions aiospamc/responses.py
BFC9
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import zlib
from enum import IntEnum
from typing import Any, Dict, SupportsBytes, Union
from typing import Any, Dict, Optional, SupportsBytes, Union

from .exceptions import *
from .header_values import ContentLengthValue, HeaderValue
Expand Down Expand Up @@ -40,7 +40,7 @@ def __init__(
version: str = "1.5",
status_code: Union[Status, int] = 0,
message: str = "",
headers: Dict[str, HeaderValue] = None,
headers: Optional[Dict[str, HeaderValue]] = None,
body: bytes = b"",
**_,
):
Expand Down
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx==5.3.0
reno==3.5.0
sphinx-toolbox==3.2.0
sphinx==6.1.3
reno==4.0.0
sphinx-toolbox==3.4.0
Loading
0