Skip to content
Open
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ repos:
- python
- pyi
repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.14.10
- hooks:
- additional_dependencies:
- aiohttp>=3.12.15
Expand All @@ -75,4 +75,4 @@ repos:
name: Pyrefly (type checking)
pass_filenames: false
repo: https://github.com/facebook/pyrefly-pre-commit
rev: 0.46.0
rev: 0.46.3
15 changes: 5 additions & 10 deletions src/apkit/abc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@

class AbstractApkitIntegration(ABC):
@abstractmethod
def outbox(self, *args) -> None:
...
def outbox(self, *args) -> None: ...

@abstractmethod
def inbox(self, *args) -> None:
...
def inbox(self, *args) -> None: ...

@abstractmethod
def on(
self, type: Union[type[Activity], type[Outbox]], func: Optional[Callable] = None
) -> Any:
def decorator(func: Callable) -> Callable:
...
def decorator(func: Callable) -> Callable: ...

@abstractmethod
def webfinger(self, func: Optional[Callable] = None) -> Any:
def decorator(func: Callable) -> Callable:
...
def decorator(func: Callable) -> Callable: ...

@abstractmethod
def nodeinfo(
Expand All @@ -33,5 +29,4 @@ def nodeinfo(
version: Literal["2.0", "2.1"],
func: Optional[Callable] = None,
) -> Any:
def decorator(fn: Callable) -> Callable:
...
def decorator(fn: Callable) -> Callable: ...
6 changes: 2 additions & 4 deletions src/apkit/abc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class AbstractContext(ABC):
request: Any

@abstractmethod
def send(self, keys: List[ActorKey], target: Actor, activity: ActivityPubModel):
...
def send(self, keys: List[ActorKey], target: Actor, activity: ActivityPubModel): ...

@abstractmethod
def get_actor_keys(self, identifier: Optional[str]) -> List[ActorKey]:
...
def get_actor_keys(self, identifier: Optional[str]) -> List[ActorKey]: ...
6 changes: 3 additions & 3 deletions src/apkit/client/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def reconstruct_headers(
if json:
if isinstance(json, ActivityPubModel):
if "content-type" not in processed_headers:
processed_headers[
"content-type"
] = "application/activity+json; charset=UTF-8"
processed_headers["content-type"] = (
"application/activity+json; charset=UTF-8"
)
processed_headers["content-type_original_key"] = "Content-Type"
elif isinstance(json, dict):
if "content-type" not in processed_headers:
Expand Down
6 changes: 3 additions & 3 deletions src/apkit/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def __init__(
Callable[[Request, WebfingerResource], Awaitable[Any]]
] = None
self.__ap_config = apkit_config
self._get_actor_keys: Optional[
Callable[[str], Awaitable[List["ActorKey"]]]
] = apkit_config.actor_keys
self._get_actor_keys: Optional[Callable[[str], Awaitable[List["ActorKey"]]]] = (
apkit_config.actor_keys
)
self.__ap_config = apkit_config

super().__init__(
Expand Down