Skip to content
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

Update project template cruft, dependencies #117

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix InvocationBase override typing error
  • Loading branch information
smkent committed Jan 15, 2025
commit 1af4490877701cbe11109ffdb89a5fe705e1c3b3
14 changes: 3 additions & 11 deletions jmapc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@

import functools
import mimetypes
from collections.abc import Generator, Sequence
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import (
Any,
Literal,
Optional,
TypeVar,
Union,
cast,
overload,
)
from collections.abc import Generator, Sequence
from typing import Any, Literal, Optional, TypeVar, Union, cast, overload

import requests
import sseclient
Expand Down Expand Up @@ -50,7 +42,7 @@ class ClientError(RuntimeError):
def __init__(
self,
*args: Any,
result: Sequence[InvocationResponseOrError],
result: Sequence[Union[InvocationResponse, InvocationResponseOrError]],
**kwargs: Any,
):
super().__init__(*args, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions jmapc/methods/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ class Invocation(InvocationBase):


@dataclass
class InvocationResponseOrError(InvocationBase):
response: Union[Error, Response]
class InvocationResponse(InvocationBase):
response: Response


@dataclass
class InvocationResponse(InvocationResponseOrError):
response: Response
class InvocationResponseOrError(InvocationBase):
response: Union[Error, Response]


class ChangesMethod:
Expand Down
Loading