Skip to content

Commit

Permalink
refactor: Fix lint/typecheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Feb 28, 2024
1 parent cf6769c commit 59a4a2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ underlines = ["", "", ""]
[tool.ruff]
line-length = 85
src = ["src"]
preview = true
target-version = "py311"

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand All @@ -57,10 +61,8 @@ select = [
# "B", # flake8-bugbear
]
ignore = ["E203","E731","E501"]
preview = true
target-version = "py311"

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["callosum"]
known-local-folder = ["src"]
split-on-trailing-comma = true
Expand Down
1 change: 0 additions & 1 deletion src/callosum/ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def cleanup(self, request_id) -> None:
self._tasks.pop(request_id, None)

async def cancel(self, request_id) -> None:
method, okey, seq = request_id
if request_id in self._futures:
task = self._tasks.get(request_id, None)
if task is None:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def dummy_client(
async def test_messaging(scheduler_cls) -> None:
done = asyncio.Event()
total = 50
call_results: List[int] = []
call_results: List[int | BaseException] = []
return_results: List[int] = []
# a list of events to make fucntions to return in the reversed order
order_events = [asyncio.Event() for _ in range(total)]
Expand Down Expand Up @@ -159,7 +159,7 @@ async def test_messaging_server_cancellation(scheduler_cls) -> None:
total = 200
cancel_idxs = [False] * 130 + [True] * 70
random.shuffle(cancel_idxs)
call_results: List[int] = []
call_results: List[int | BaseException] = []
return_results: List[int] = []
# a list of events to make fucntions to return in the reversed order
order_events = [asyncio.Event() for _ in range(total)]
Expand Down Expand Up @@ -232,7 +232,7 @@ async def test_messaging_server_error(scheduler_cls) -> None:
total = 200
error_idxs = [False] * 130 + [True] * 70
random.shuffle(error_idxs)
call_results: List[int] = []
call_results: List[int | BaseException] = []
return_results: List[int] = []
# a list of events to make fucntions to return in the reversed order
order_events = [asyncio.Event() for _ in range(total)]
Expand Down

0 comments on commit 59a4a2b

Please sign in to comment.