Skip to content

Commit 008fc55

Browse files
authored
Remove deprecation message and code related to old API. (#50)
1 parent 9c2ffd6 commit 008fc55

File tree

4 files changed

+13
-39
lines changed

4 files changed

+13
-39
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ 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.3.0 - 2022-12-xx
8+
9+
- {pull}`50` removes the deprecation message and related code to the old API.
10+
711
## 0.2.1 - 2022-04-19
812

913
- {pull}`40` fixes the error message which advises user to transition to the new

src/pytask_latex/collect.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def task_latex():
6767

6868
def latex(
6969
*,
70-
script: str | Path = None,
71-
document: str | Path = None,
70+
script: str | Path,
71+
document: str | Path,
7272
compilation_steps: str
7373
| Callable[..., Any]
7474
| Sequence[str | Callable[..., Any]] = None,
@@ -77,14 +77,14 @@ def latex(
7777
7878
Parameters
7979
----------
80-
options
81-
One or multiple command line options passed to latexmk.
80+
script : str | Path
81+
The LaTeX file that will be compiled.
82+
document : str | Path
83+
The path to the compiled document.
8284
compilation_steps
8385
Compilation steps to compile the document.
8486
8587
"""
86-
if script is None or document is None:
87-
raise RuntimeError(_ERROR_MSG)
8888
return script, document, compilation_steps
8989

9090

tests/test_collect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
@pytest.mark.parametrize(
1111
"kwargs, expectation, expected",
1212
[
13-
({}, pytest.raises(RuntimeError, match="The old syntax"), None),
13+
({}, pytest.raises(TypeError, match=r"latex\(\) missing 2 required"), None),
1414
(
1515
{"document": "document.pdf"},
16-
pytest.raises(RuntimeError, match="The old syntax"),
16+
pytest.raises(TypeError, match=r"latex\(\) missing 1 required"),
1717
None,
1818
),
1919
(
2020
{"script": "script.tex"},
21-
pytest.raises(RuntimeError, match="The old syntax"),
21+
pytest.raises(TypeError, match=r"latex\(\) missing 1 required"),
2222
None,
2323
),
2424
(

tests/test_execute.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,6 @@ def test_pytask_execute_task_setup(monkeypatch):
2929
pytask_execute_task_setup(task)
3030

3131

32-
@needs_latexmk
33-
@skip_on_github_actions_with_win
34-
@pytest.mark.end_to_end
35-
def test_compile_latex_document_raise_error_old_api(runner, tmp_path):
36-
"""Test simple compilation."""
37-
task_source = """
38-
import pytask
39-
40-
@pytask.mark.latex
41-
@pytask.mark.depends_on("document.tex")
42-
@pytask.mark.produces("document.pdf")
43-
def task_compile_document():
44-
pass
45-
"""
46-
tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source))
47-
48-
latex_source = r"""
49-
\documentclass{report}
50-
\begin{document}
51-
I was tired of my lady
52-
\end{document}
53-
"""
54-
tmp_path.joinpath("document.tex").write_text(textwrap.dedent(latex_source))
55-
56-
result = runner.invoke(cli, [tmp_path.as_posix()])
57-
58-
assert result.exit_code == ExitCode.COLLECTION_FAILED
59-
assert "The old syntax for @pytask.mark.latex" in result.output
60-
61-
6232
@needs_latexmk
6333
@skip_on_github_actions_with_win
6434
@pytest.mark.end_to_end

0 commit comments

Comments
 (0)