diff --git a/CHANGES.md b/CHANGES.md index 1b71259..4bc9009 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ This is a record of all past pytask-latex releases and what went into them in re chronological order. Releases follow [semantic versioning](https://semver.org/) and all releases are available on [Anaconda.org](https://anaconda.org/conda-forge/pytask-latex). +## 0.3.0 - 2022-12-xx + +- {pull}`50` removes the deprecation message and related code to the old API. + ## 0.2.1 - 2022-04-19 - {pull}`40` fixes the error message which advises user to transition to the new diff --git a/src/pytask_latex/collect.py b/src/pytask_latex/collect.py index a74ed85..dead405 100644 --- a/src/pytask_latex/collect.py +++ b/src/pytask_latex/collect.py @@ -67,8 +67,8 @@ def task_latex(): def latex( *, - script: str | Path = None, - document: str | Path = None, + script: str | Path, + document: str | Path, compilation_steps: str | Callable[..., Any] | Sequence[str | Callable[..., Any]] = None, @@ -77,14 +77,14 @@ def latex( Parameters ---------- - options - One or multiple command line options passed to latexmk. + script : str | Path + The LaTeX file that will be compiled. + document : str | Path + The path to the compiled document. compilation_steps Compilation steps to compile the document. """ - if script is None or document is None: - raise RuntimeError(_ERROR_MSG) return script, document, compilation_steps diff --git a/tests/test_collect.py b/tests/test_collect.py index efc3ddd..e5e26fa 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -10,15 +10,15 @@ @pytest.mark.parametrize( "kwargs, expectation, expected", [ - ({}, pytest.raises(RuntimeError, match="The old syntax"), None), + ({}, pytest.raises(TypeError, match=r"latex\(\) missing 2 required"), None), ( {"document": "document.pdf"}, - pytest.raises(RuntimeError, match="The old syntax"), + pytest.raises(TypeError, match=r"latex\(\) missing 1 required"), None, ), ( {"script": "script.tex"}, - pytest.raises(RuntimeError, match="The old syntax"), + pytest.raises(TypeError, match=r"latex\(\) missing 1 required"), None, ), ( diff --git a/tests/test_execute.py b/tests/test_execute.py index 5321196..3c89f26 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -29,36 +29,6 @@ def test_pytask_execute_task_setup(monkeypatch): pytask_execute_task_setup(task) -@needs_latexmk -@skip_on_github_actions_with_win -@pytest.mark.end_to_end -def test_compile_latex_document_raise_error_old_api(runner, tmp_path): - """Test simple compilation.""" - task_source = """ - import pytask - - @pytask.mark.latex - @pytask.mark.depends_on("document.tex") - @pytask.mark.produces("document.pdf") - def task_compile_document(): - pass - """ - tmp_path.joinpath("task_dummy.py").write_text(textwrap.dedent(task_source)) - - latex_source = r""" - \documentclass{report} - \begin{document} - I was tired of my lady - \end{document} - """ - tmp_path.joinpath("document.tex").write_text(textwrap.dedent(latex_source)) - - result = runner.invoke(cli, [tmp_path.as_posix()]) - - assert result.exit_code == ExitCode.COLLECTION_FAILED - assert "The old syntax for @pytask.mark.latex" in result.output - - @needs_latexmk @skip_on_github_actions_with_win @pytest.mark.end_to_end