Skip to content

Commit 56321d5

Browse files
committed
Remove unnecessary hook.
1 parent b915ca9 commit 56321d5

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

src/pytask_latex/collect.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
from _pytask.config import hookimpl
1515
from _pytask.mark import Mark
1616
from _pytask.mark_utils import get_specific_markers_from_task
17-
from _pytask.mark_utils import has_marker
1817
from _pytask.nodes import _collect_nodes
1918
from _pytask.nodes import FilePathNode
20-
from _pytask.nodes import PythonFunctionTask
2119
from _pytask.parametrize import _copy_func
2220
from pytask_latex import compilation_steps as cs
2321
from pytask_latex.utils import to_list
@@ -91,23 +89,6 @@ def compile_latex_document(compilation_steps, path_to_tex, path_to_document):
9189
raise RuntimeError(f"Compilation step {step.__name__} failed.") from e
9290

9391

94-
@hookimpl
95-
def pytask_collect_task(session, path, name, obj):
96-
"""Collect a task which is a function.
97-
98-
There is some discussion on how to detect functions in this `thread
99-
<https://stackoverflow.com/q/624926/7523785>`_. :class:`types.FunctionType` does not
100-
detect built-ins which is not possible anyway.
101-
102-
"""
103-
if name.startswith("task_") and callable(obj) and has_marker(obj, "latex"):
104-
task = PythonFunctionTask.from_path_name_function_session(
105-
path, name, obj, session
106-
)
107-
108-
return task
109-
110-
11192
@hookimpl
11293
def pytask_collect_task_teardown(session, task):
11394
"""Perform some checks."""

tests/test_collect.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from __future__ import annotations
22

33
from contextlib import ExitStack as does_not_raise # noqa: N813
4-
from pathlib import Path
54

65
import pytest
76
from _pytask.mark import Mark
87
from _pytask.nodes import FilePathNode
98
from pytask_latex.collect import _get_node_from_dictionary
109
from pytask_latex.collect import _merge_all_markers
11-
from pytask_latex.collect import pytask_collect_task
1210
from pytask_latex.collect import pytask_collect_task_teardown
1311

1412

@@ -41,24 +39,6 @@ def test_merge_all_markers(marks, expected):
4139
assert out == expected
4240

4341

44-
@pytest.mark.unit
45-
@pytest.mark.parametrize(
46-
"name, expected",
47-
[("task_dummy", True), ("invalid_name", None)],
48-
)
49-
def test_pytask_collect_task(name, expected):
50-
session = DummyClass()
51-
path = Path("some_path")
52-
task_dummy.pytaskmark = [Mark("latex", (), {})]
53-
54-
task = pytask_collect_task(session, path, name, task_dummy)
55-
56-
if expected:
57-
assert task
58-
else:
59-
assert not task
60-
61-
6242
@pytest.mark.unit
6343
@pytest.mark.parametrize(
6444
"depends_on, produces, expectation",

0 commit comments

Comments
 (0)