@@ -49,16 +49,16 @@ def test_run_jl_script( # noqa: PLR0913
49
49
depends_on ,
50
50
):
51
51
task_source = f"""
52
- import pytask
52
+ from pytask import task, mark
53
+ from pathlib import Path
53
54
54
- @pytask.mark.julia(
55
- script="script.jl",
55
+ @task(kwargs={{"depends_on": { depends_on } , "produces": "out.txt"}})
56
+ @mark.julia(
57
+ script=Path("script.jl"),
56
58
serializer="{ serializer } ",
57
59
suffix="{ suffix } ",
58
60
project="{ ROOT .as_posix ()} ",
59
61
)
60
- @pytask.mark.depends_on({ depends_on } )
61
- @pytask.mark.produces("out.txt")
62
62
def task_run_jl_script():
63
63
pass
64
64
"""
@@ -92,16 +92,15 @@ def test_run_jl_script_w_task_decorator(
92
92
runner , tmp_path , parse_config_code , serializer , suffix
93
93
):
94
94
task_source = f"""
95
- import pytask
95
+ from pytask import mark, task
96
96
97
- @pytask.mark. task
98
- @pytask. mark.julia(
97
+ @task(kwargs={{"produces": "out.txt"}})
98
+ @mark.julia(
99
99
script="script.jl",
100
100
serializer="{ serializer } ",
101
101
suffix="{ suffix } ",
102
102
project="{ ROOT .as_posix ()} "
103
103
)
104
- @pytask.mark.produces("out.txt")
105
104
def run_jl_script():
106
105
pass
107
106
"""
@@ -133,15 +132,15 @@ def test_raise_error_if_julia_is_not_found(
133
132
suffix ,
134
133
):
135
134
task_source = f"""
136
- import pytask
135
+ from pytask import mark, task
137
136
138
- @pytask.mark.julia(
137
+ @task(kwargs={{"produces": "out.txt"}})
138
+ @mark.julia(
139
139
script="script.jl",
140
140
serializer="{ serializer } ",
141
141
suffix="{ suffix } ",
142
142
project="{ ROOT .as_posix ()} ",
143
143
)
144
- @pytask.mark.produces("out.txt")
145
144
def task_run_jl_script():
146
145
pass
147
146
"""
@@ -179,16 +178,16 @@ def test_run_jl_script_w_wrong_cmd_option(
179
178
suffix ,
180
179
):
181
180
task_source = f"""
182
- import pytask
181
+ from pytask import mark, task
183
182
184
- @pytask.mark.julia(
183
+ @task(kwargs={{"produces": "out.txt"}})
184
+ @mark.julia(
185
185
script="script.jl",
186
186
options=("--wrong-flag"),
187
187
serializer="{ serializer } ",
188
188
suffix="{ suffix } ",
189
189
project="{ ROOT .as_posix ()} ",
190
190
)
191
- @pytask.mark.produces("out.txt")
192
191
def task_run_jl_script():
193
192
pass
194
193
@@ -220,16 +219,16 @@ def test_check_passing_cmd_line_options( # noqa: PLR0913
220
219
suffix ,
221
220
):
222
221
task_source = f"""
223
- import pytask
222
+ from pytask import mark, task
224
223
225
- @pytask.mark.julia(
224
+ @task(kwargs={{"produces": "out.txt"}})
225
+ @mark.julia(
226
226
script="script.jl",
227
227
options=("--threads", "{ n_threads } "),
228
228
serializer="{ serializer } ",
229
229
suffix="{ suffix } ",
230
230
project="{ ROOT .as_posix ()} "
231
231
)
232
- @pytask.mark.produces("out.txt")
233
232
def task_run_jl_script():
234
233
pass
235
234
@@ -265,14 +264,14 @@ def test_run_jl_script_w_environment_in_config( # noqa: PLR0913
265
264
path ,
266
265
):
267
266
task_source = f"""
268
- import pytask
267
+ from pytask import mark, task
269
268
270
- @pytask.mark.julia(
269
+ @task(kwargs={{"produces": "out.txt"}})
270
+ @mark.julia(
271
271
script="script.jl",
272
272
serializer="{ serializer } ",
273
273
suffix="{ suffix } ",
274
274
)
275
- @pytask.mark.produces("out.txt")
276
275
def task_run_jl_script():
277
276
pass
278
277
"""
@@ -319,15 +318,15 @@ def test_run_jl_script_w_environment_relative_to_task(
319
318
project_in_task = Path (os .path .relpath (ROOT , tmp_path )).as_posix ()
320
319
321
320
task_source = f"""
322
- import pytask
321
+ from pytask import mark, task
323
322
324
- @pytask.mark.julia(
323
+ @task(kwargs={{"produces": "out.txt"}})
324
+ @mark.julia(
325
325
script="script.jl",
326
326
serializer="{ serializer } ",
327
327
suffix="{ suffix } ",
328
328
project="{ project_in_task } ",
329
329
)
330
- @pytask.mark.produces("out.txt")
331
330
def task_run_jl_script():
332
331
pass
333
332
"""
@@ -352,15 +351,15 @@ def task_run_jl_script():
352
351
@pytest .mark .end_to_end ()
353
352
def test_run_jl_script_w_custom_serializer (runner , tmp_path ):
354
353
task_source = f"""
355
- import pytask
354
+ from pytask import mark, task
356
355
import json
357
356
358
- @pytask.mark.julia(
357
+ @task(kwargs={{"produces": "out.txt"}})
358
+ @mark.julia(
359
359
script="script.jl",
360
360
serializer=json.dumps,
361
361
project="{ ROOT .as_posix ()} ",
362
362
)
363
- @pytask.mark.produces("out.txt")
364
363
def task_run_jl_script():
365
364
pass
366
365
"""
@@ -385,11 +384,11 @@ def task_run_jl_script():
385
384
@pytest .mark .end_to_end ()
386
385
def test_run_jl_script_fails_w_multiple_markers (runner , tmp_path ):
387
386
task_source = """
388
- import pytask
387
+ from pytask import mark, task
389
388
390
- @pytask.mark.julia(script="script.jl" )
391
- @pytask. mark.julia(script="script.jl")
392
- @pytask. mark.produces("out.txt ")
389
+ @task(kwargs={"produces": "out.txt"} )
390
+ @mark.julia(script="script.jl")
391
+ @mark.julia(script="script.jl ")
393
392
def task_run_jl_script():
394
393
pass
395
394
"""
0 commit comments