Skip to content

Commit 881bd5b

Browse files
committed
fix up typing
1 parent 129437f commit 881bd5b

File tree

6 files changed

+13
-27
lines changed

6 files changed

+13
-27
lines changed

pyproject.toml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
[tool.black]
2-
line-length = 79
3-
exclude = '''
4-
/(
5-
\.git
6-
)/
7-
'''
8-
9-
[tool.isort]
10-
skip = ['.git', 'venv']
11-
known_tests = 'tests'
12-
sections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'TESTS', 'LOCALFOLDER']
13-
default_section = 'THIRDPARTY'
14-
use_parentheses = true
15-
multi_line_output = 3
16-
include_trailing_comma = true
17-
force_grid_wrap = 0
18-
combine_as_imports = true
19-
line_length = 79
20-
float_to_top = true
1+
[tool.mypy]
2+
ignore_missing_imports = true
3+
follow_imports = "skip"

requirements-lint.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
mypy==1.19.0
12
ruff==0.14.7
23
types-redis

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
VERSION_FILE = "tasktiger/__init__.py"
66
with open(VERSION_FILE, encoding="utf8") as fd:
7-
version = re.search(r'__version__ = ([\'"])(.*?)\1', fd.read()).group(2)
7+
version = re.search(r'__version__ = ([\'"])(.*?)\1', fd.read()).group(2) # type: ignore
88

99
with open("README.rst", encoding="utf-8") as file:
1010
long_description = file.read()

tasktiger/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_eager_task(self, task: "Task") -> None:
4242
"""
4343
raise NotImplementedError("Eager tasks are not supported.")
4444

45-
def on_permanent_error(self, task: "Task", execution: Dict[str, Any]) -> None:
45+
def on_permanent_error(self, task: "Task", execution: Dict[str, Any] | None) -> None:
4646
"""
4747
Called if the task fails permanently.
4848

tasktiger/task.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,9 @@ def tasks_from_queue(
532532
for idx, serialized_data, serialized_executions, ts in zip(
533533
range(len(items)), results[0], results[1:], tss
534534
):
535-
if serialized_data is None and include_not_found:
536-
data = {"id": items[idx][0]}
535+
if serialized_data is None:
536+
if include_not_found:
537+
data = {"id": items[idx][0]}
537538
else:
538539
data = json.loads(serialized_data)
539540

@@ -554,8 +555,9 @@ def tasks_from_queue(
554555
[tiger._key("task", item[0]) for item in items]
555556
)
556557
for idx, serialized_data, ts in zip(range(len(items)), result, tss):
557-
if serialized_data is None and include_not_found:
558-
data = {"id": items[idx][0]}
558+
if serialized_data is None:
559+
if include_not_found:
560+
data = {"id": items[idx][0]}
559561
else:
560562
data = json.loads(serialized_data)
561563

tasktiger/tasktiger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Iterable,
1414
List,
1515
Optional,
16+
ParamSpec,
1617
Tuple,
1718
Type,
1819
TypeVar,
@@ -24,7 +25,6 @@
2425
import redis
2526
import structlog
2627
from structlog.stdlib import BoundLogger
27-
from typing_extensions import ParamSpec
2828

2929
from ._internal import (
3030
ACTIVE,

0 commit comments

Comments
 (0)