Skip to content

Commit c2b96d5

Browse files
authored
Release 0.0.6 and fix pytask_collect_task_teardown. (#9)
1 parent 6a7d67a commit c2b96d5

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ all releases are available on `Anaconda.org
77
<https://anaconda.org/pytask/pytask-latex>`_.
88

99

10+
0.0.6 - 2020-10-14
11+
------------------
12+
13+
- :gh:`9` fixes the last release and the ``pytask_collect_task_teardown`` call.
14+
15+
1016
0.0.5 - 2020-10-04
1117
------------------
1218

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.0.5
2+
current_version = 0.0.6
33
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))(\-?((dev)?(?P<dev>\d+))?)
44
serialize =
55
{major}.{minor}.{patch}dev{dev}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="pytask-latex",
6-
version="0.0.5",
6+
version="0.0.6",
77
packages=find_packages(where="src"),
88
package_dir={"": "src"},
99
entry_points={"pytask": ["pytask_latex = pytask_latex.plugin"]},

src/pytask_latex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.5"
1+
__version__ = "0.0.6"

src/pytask_latex/collect.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ def pytask_collect_task(session, path, name, obj):
103103

104104
@hookimpl
105105
def pytask_collect_task_teardown(task):
106-
"""Perform some checks."""
107-
if task is not None:
106+
"""Perform some checks.
107+
108+
Remove check for task is none with pytask 0.0.9.
109+
110+
"""
111+
if task is not None and get_specific_markers_from_task(task, "latex"):
108112
if (len(task.depends_on) == 0) or (
109113
not (
110114
isinstance(task.depends_on[0], FilePathNode)

tests/test_execute.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import itertools
12
import textwrap
23
from contextlib import ExitStack as does_not_raise # noqa: N813
34
from subprocess import CalledProcessError
@@ -15,6 +16,36 @@ class DummyTask:
1516
pass
1617

1718

19+
@pytest.mark.end_to_end
20+
@pytest.mark.parametrize(
21+
"dependencies, products",
22+
itertools.product(
23+
([], ["in.txt"], ["in_1.txt", "in_2.txt"]),
24+
(["out.txt"], ["out_1.txt", "out_2.txt"]),
25+
),
26+
)
27+
def test_normal_flow_w_varying_dependencies_products(tmp_path, dependencies, products):
28+
source = f"""
29+
import pytask
30+
from pathlib import Path
31+
32+
33+
@pytask.mark.depends_on({dependencies})
34+
@pytask.mark.produces({products})
35+
def task_dummy(depends_on, produces):
36+
if not isinstance(produces, list):
37+
produces = [produces]
38+
for product in produces:
39+
product.touch()
40+
"""
41+
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(source))
42+
for dependency in dependencies:
43+
tmp_path.joinpath(dependency).touch()
44+
45+
session = main({"paths": tmp_path})
46+
assert session.exit_code == 0
47+
48+
1849
@pytest.mark.unit
1950
@pytest.mark.parametrize(
2051
"found_latexmk, expectation",

0 commit comments

Comments
 (0)