Skip to content

Fix error message for the old interface. #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/pytask_latex/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
...
Expand Down
19 changes: 13 additions & 6 deletions tests/test_latex_dependency_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down