Skip to content

Commit

Permalink
[refactor] done fixing mypy issues of syft/exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaguin committed Feb 22, 2024
1 parent 81d06d4 commit 2604b1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ repos:
- id: mypy
name: "mypy: syft"
always_run: true
files: "^packages/syft/src/syft/client|^packages/syft/src/syft/node"
files: "^packages/syft/src/syft/client|^packages/syft/src/syft/enclave|^packages/syft/src/syft/node|^packages/syft/src/syft/shylock|^packages/syft/src/syft/exceptions"
# files: "^packages/syft/src/syft/"
# files: "^packages/syft/src/syft/abstract_node.py"
args: [
"--follow-imports=skip",
"--ignore-missing-imports",
Expand Down
5 changes: 4 additions & 1 deletion packages/syft/src/syft/exceptions/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from typing import List
from typing import Optional

# third party
from typing_extensions import Self

# relative
from ..service.context import NodeServiceContext
from ..service.response import SyftError
Expand All @@ -16,7 +19,7 @@ def __init__(self, message: str, roles: Optional[List[ServiceRole]] = None):
self.message = message
self.roles = roles if roles else [ServiceRole.ADMIN]

def raise_with_context(self, context: NodeServiceContext):
def raise_with_context(self, context: NodeServiceContext) -> Self:
self.context = context
return self

Expand Down

0 comments on commit 2604b1c

Please sign in to comment.