Skip to content

Commit 4c5fcbd

Browse files
committed
Fix ty typing diagnostics
1 parent 80e56bb commit 4c5fcbd

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/_pytask/config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ def is_file_system_case_sensitive() -> bool:
6565
def pytask_configure(pm: PluginManager, raw_config: dict[str, Any]) -> dict[str, Any]:
6666
"""Configure pytask."""
6767
# Add all values by default so that many plugins do not need to copy over values.
68-
config = {"pm": pm, "markers": {}} | raw_config
69-
config["markers"] = parse_markers(config["markers"])
68+
markers = raw_config.get("markers", {})
69+
if not isinstance(markers, (dict, list, tuple)):
70+
msg = "'markers' must be a mapping or a sequence of marker definitions."
71+
raise TypeError(msg)
72+
config = {"pm": pm, "markers": parse_markers(markers)} | raw_config
7073

7174
pm.hook.pytask_parse_config(config=config)
7275
pm.hook.pytask_post_parse(config=config)

src/_pytask/task_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def wrapper(func: T) -> TaskDecorated[T]:
199199

200200
# When decorator is used without parentheses, call wrapper directly.
201201
if is_task_function(name) and kwargs is None:
202-
return wrapper(cast("T", name)) # ty: ignore[invalid-argument-type]
202+
return wrapper(cast("T", name))
203203
return wrapper
204204

205205

0 commit comments

Comments
 (0)