Skip to content

Commit 364ea7f

Browse files
committed
Add hook module option.
1 parent cf599fb commit 364ea7f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/_pytask/parameters.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,21 @@ def _database_url_callback(
103103
)
104104

105105

106+
_HOOK_MODULE_OPTION = click.Option(
107+
["--hook-module"],
108+
type=str,
109+
help="Path to a Python module that contains hook implementations.",
110+
multiple=True,
111+
)
112+
113+
106114
@hookimpl(trylast=True)
107115
def pytask_extend_command_line_interface(cli: click.Group) -> None:
108116
"""Register general markers."""
109117
for command in ("build", "clean", "collect", "dag", "profile"):
110-
cli.commands[command].params.extend([_PATH_ARGUMENT, _DATABASE_URL_OPTION])
118+
cli.commands[command].params.extend(
119+
[_PATH_ARGUMENT, _DATABASE_URL_OPTION, _HOOK_MODULE_OPTION]
120+
)
111121
for command in ("build", "clean", "collect", "dag", "markers", "profile"):
112122
cli.commands[command].params.append(_CONFIG_OPTION)
113123
for command in ("build", "clean", "collect", "profile"):

0 commit comments

Comments
 (0)