Skip to content

Commit 96dc820

Browse files
authored
Fix error message for the old interface. (#40)
1 parent bbed260 commit 96dc820

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ repos:
8787
rev: v2.1.0
8888
hooks:
8989
- id: codespell
90-
args: [-L als, -L unparseable]
90+
args: [-L als]
9191
- repo: https://github.com/mgedmin/check-manifest
9292
rev: "0.48"
9393
hooks:

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This is a record of all past pytask-latex releases and what went into them in re
44
chronological order. Releases follow [semantic versioning](https://semver.org/) and all
55
releases are available on [Anaconda.org](https://anaconda.org/conda-forge/pytask-latex).
66

7+
## 0.2.1 - 2022-04-19
8+
9+
- {pull}`40` fixes the error message which advises user to transition to the new
10+
interface.
11+
712
## 0.2.0 - 2022-04-16
813

914
- {pull}`33` aligns pytask-latex with the pytask v0.2.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020-2021 Tobias Raabe
1+
Copyright 2020 Tobias Raabe
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this
44
software and associated documentation files (the "Software"), to deal in the Software

src/pytask_latex/collect.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ def task_latex():
4747
4848
to
4949
50+
from pytask_latex import compilation_steps as cs
51+
52+
5053
@pytask.mark.latex(
5154
script="script.tex",
5255
document="document.pdf",
53-
options="--some-options"
56+
compilation_steps=cs.latexmk(options="--some-options"),
5457
)
5558
def task_latex():
5659
...

tests/test_latex_dependency_scanner.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@
1212
@needs_latexmk
1313
@skip_on_github_actions_with_win
1414
@pytest.mark.end_to_end
15-
@pytest.mark.parametrize("infer_dependencies", [True, False])
16-
def test_infer_dependencies_from_task(tmp_path, infer_dependencies):
15+
@pytest.mark.parametrize("infer_dependencies", ["true", "false"])
16+
@pytest.mark.parametrize(
17+
"config_file, content",
18+
[
19+
("pytask.ini", "[pytask]\ninfer_latex_dependencies = {}"),
20+
("pyproject.toml", "[tool.pytask.ini_options]\ninfer_latex_dependencies = {}"),
21+
],
22+
)
23+
def test_infer_dependencies_from_task(
24+
tmp_path, infer_dependencies, config_file, content
25+
):
1726
task_source = """
1827
import pytask
1928
@@ -32,14 +41,12 @@ def task_compile_document():
3241
tmp_path.joinpath("document.tex").write_text(textwrap.dedent(latex_source))
3342
tmp_path.joinpath("sub_document.tex").write_text("Lorem ipsum.")
3443

35-
tmp_path.joinpath("pytask.ini").write_text(
36-
f"[pytask]\ninfer_latex_dependencies = {infer_dependencies}"
37-
)
44+
tmp_path.joinpath(config_file).write_text(content.format(infer_dependencies))
3845

3946
session = main({"paths": tmp_path})
4047
assert session.exit_code == ExitCode.OK
4148
assert len(session.tasks) == 1
42-
if infer_dependencies:
49+
if infer_dependencies == "true":
4350
assert len(session.tasks[0].depends_on) == 2
4451
else:
4552
assert len(session.tasks[0].depends_on) == 1

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ filterwarnings =
4141
ignore: the imp module is deprecated in favour of importlib
4242
ignore: Using or importing the ABCs from 'collections'
4343
ignore: The (parser|symbol) module is deprecated and will be removed in future
44-
junit_family = xunit2
4544
markers =
4645
wip: Tests that are work-in-progress.
4746
unit: Flag for unit tests which target mainly a single function.

0 commit comments

Comments
 (0)