diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07e365d..daa9149 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -87,7 +87,7 @@ repos: rev: v2.1.0 hooks: - id: codespell - args: [-L als, -L unparseable] + args: [-L als] - repo: https://github.com/mgedmin/check-manifest rev: "0.48" hooks: diff --git a/CHANGES.md b/CHANGES.md index 0c549f2..1b71259 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,11 @@ 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.2.1 - 2022-04-19 + +- {pull}`40` fixes the error message which advises user to transition to the new + interface. + ## 0.2.0 - 2022-04-16 - {pull}`33` aligns pytask-latex with the pytask v0.2. diff --git a/LICENSE b/LICENSE index 4c96cf3..f4c44ec 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2020-2021 Tobias Raabe +Copyright 2020 Tobias Raabe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software diff --git a/src/pytask_latex/collect.py b/src/pytask_latex/collect.py index 66b561d..a74ed85 100644 --- a/src/pytask_latex/collect.py +++ b/src/pytask_latex/collect.py @@ -47,10 +47,13 @@ def task_latex(): to + from pytask_latex import compilation_steps as cs + + @pytask.mark.latex( script="script.tex", document="document.pdf", - options="--some-options" + compilation_steps=cs.latexmk(options="--some-options"), ) def task_latex(): ... diff --git a/tests/test_latex_dependency_scanner.py b/tests/test_latex_dependency_scanner.py index 0c33aaf..30682cb 100644 --- a/tests/test_latex_dependency_scanner.py +++ b/tests/test_latex_dependency_scanner.py @@ -12,8 +12,17 @@ @needs_latexmk @skip_on_github_actions_with_win @pytest.mark.end_to_end -@pytest.mark.parametrize("infer_dependencies", [True, False]) -def test_infer_dependencies_from_task(tmp_path, infer_dependencies): +@pytest.mark.parametrize("infer_dependencies", ["true", "false"]) +@pytest.mark.parametrize( + "config_file, content", + [ + ("pytask.ini", "[pytask]\ninfer_latex_dependencies = {}"), + ("pyproject.toml", "[tool.pytask.ini_options]\ninfer_latex_dependencies = {}"), + ], +) +def test_infer_dependencies_from_task( + tmp_path, infer_dependencies, config_file, content +): task_source = """ import pytask @@ -32,14 +41,12 @@ def task_compile_document(): tmp_path.joinpath("document.tex").write_text(textwrap.dedent(latex_source)) tmp_path.joinpath("sub_document.tex").write_text("Lorem ipsum.") - tmp_path.joinpath("pytask.ini").write_text( - f"[pytask]\ninfer_latex_dependencies = {infer_dependencies}" - ) + tmp_path.joinpath(config_file).write_text(content.format(infer_dependencies)) session = main({"paths": tmp_path}) assert session.exit_code == ExitCode.OK assert len(session.tasks) == 1 - if infer_dependencies: + if infer_dependencies == "true": assert len(session.tasks[0].depends_on) == 2 else: assert len(session.tasks[0].depends_on) == 1 diff --git a/tox.ini b/tox.ini index a2f750d..b8d4147 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,6 @@ filterwarnings = ignore: the imp module is deprecated in favour of importlib ignore: Using or importing the ABCs from 'collections' ignore: The (parser|symbol) module is deprecated and will be removed in future -junit_family = xunit2 markers = wip: Tests that are work-in-progress. unit: Flag for unit tests which target mainly a single function.