Skip to content

Commit f1db17c

Browse files
authored
Remove unnecessary hook implementation. (#8)
1 parent 477edec commit f1db17c

File tree

5 files changed

+9
-41
lines changed

5 files changed

+9
-41
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Integration Workflow
1+
name: main
22

33
# Automatically cancel a previous run.
44
concurrency:

CHANGES.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ them in reverse chronological order. Releases follow `semantic versioning
88
<https://anaconda.org/conda-forge/pytask-julia>`_.
99

1010

11-
0.1.0 - 2022-xx-xx
11+
0.2.0 - 2022-xx-xx
12+
------------------
13+
14+
- :gh:`8` removes an unnecessary hook.
15+
16+
17+
0.1.0 - 2022-01-19
1218
------------------
1319

1420
- :gh:`2` polishes the first release of pytask-julia. (Thanks to :ghuser:`hmgaudecker`,

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pytask-julia
1919
:alt: PyPI - License
2020
:target: https://pypi.org/project/pytask-julia
2121

22-
.. image:: https://img.shields.io/github/workflow/status/pytask-dev/pytask-julia/Continuous%20Integration%20Workflow/main
22+
.. image:: https://img.shields.io/github/workflow/status/pytask-dev/pytask-julia/main/main
2323
:target: https://github.com/pytask-dev/pytask-julia/actions?query=branch%3Amain
2424

2525
.. image:: https://codecov.io/gh/pytask-dev/pytask-julia/branch/main/graph/badge.svg

src/pytask_julia/collect.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
from _pytask.config import hookimpl
1111
from _pytask.mark_utils import get_specific_markers_from_task
12-
from _pytask.mark_utils import has_marker
1312
from _pytask.nodes import FilePathNode
14-
from _pytask.nodes import PythonFunctionTask
1513
from _pytask.parametrize import _copy_func
1614

1715

@@ -40,23 +38,6 @@ def run_jl_script(julia):
4038
subprocess.run(julia, check=True)
4139

4240

43-
@hookimpl
44-
def pytask_collect_task(session, path, name, obj):
45-
"""Collect a task which is a function.
46-
47-
There is some discussion on how to detect functions in this `thread
48-
<https://stackoverflow.com/q/624926/7523785>`_. :class:`types.FunctionType` does not
49-
detect built-ins which is not possible anyway.
50-
51-
"""
52-
if name.startswith("task_") and callable(obj) and has_marker(obj, "julia"):
53-
task = PythonFunctionTask.from_path_name_function_session(
54-
path, name, obj, session
55-
)
56-
57-
return task
58-
59-
6041
@hookimpl
6142
def pytask_collect_task_teardown(session, task):
6243
"""Perform some checks."""

tests/test_collect.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pytask_julia.collect import _merge_all_markers
99
from pytask_julia.collect import _prepare_cmd_options
1010
from pytask_julia.collect import julia
11-
from pytask_julia.collect import pytask_collect_task
1211
from pytask_julia.collect import pytask_collect_task_teardown
1312

1413

@@ -55,24 +54,6 @@ def test_merge_all_markers(marks, expected):
5554
assert out == expected
5655

5756

58-
@pytest.mark.unit
59-
@pytest.mark.parametrize(
60-
"name, expected",
61-
[("task_dummy", True), ("invalid_name", None)],
62-
)
63-
def test_pytask_collect_task(name, expected):
64-
session = DummyClass()
65-
path = Path("some_path")
66-
task_dummy.pytaskmark = [Mark("julia", (), {})]
67-
68-
task = pytask_collect_task(session, path, name, task_dummy)
69-
70-
if expected:
71-
assert task
72-
else:
73-
assert not task
74-
75-
7657
@pytest.mark.unit
7758
@pytest.mark.parametrize(
7859
"depends_on, produces, expectation",

0 commit comments

Comments
 (0)