Skip to content

Commit 96f6416

Browse files
[pre-commit.ci] pre-commit autoupdate (#76)
1 parent dc8b64a commit 96f6416

File tree

10 files changed

+44
-41
lines changed

10 files changed

+44
-41
lines changed

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ______________________________________________________________________
88
#### Is your feature request related to a problem?
99

1010
Provide a description of what the problem is, e.g. "I wish I could use pytask-latex to
11-
do \[...\]".
11+
do [...]".
1212

1313
#### Describe the solution you'd like
1414

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=100']
@@ -26,16 +26,16 @@ repos:
2626
- id: python-use-type-annotations
2727
- id: text-unicode-replacement-char
2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.4.1
29+
rev: v0.11.11
3030
hooks:
3131
- id: ruff
3232
- id: ruff-format
3333
- repo: https://github.com/dosisod/refurb
34-
rev: v2.0.0
34+
rev: v2.1.0
3535
hooks:
3636
- id: refurb
3737
- repo: https://github.com/executablebooks/mdformat
38-
rev: 0.7.17
38+
rev: 0.7.22
3939
hooks:
4040
- id: mdformat
4141
additional_dependencies: [
@@ -44,7 +44,7 @@ repos:
4444
]
4545
args: [--wrap, "88"]
4646
- repo: https://github.com/codespell-project/codespell
47-
rev: v2.2.6
47+
rev: v2.4.1
4848
hooks:
4949
- id: codespell
5050
args: [-L als, -L falsy]

src/pytask_latex/collect.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ def pytask_collect_task(
219219
def pytask_collect_modify_tasks(session: Session, tasks: list[PTask]) -> None:
220220
"""Add dependencies from from LaTeX documents to tasks."""
221221
if session.config["infer_latex_dependencies"]:
222-
all_products = {
222+
all_products = { # type: ignore[var-annotated]
223223
product.path
224224
for task in tasks
225-
for product in tree_leaves(task.produces)
225+
for product in tree_leaves(task.produces) # type: ignore[arg-type]
226226
if isinstance(product, PPathNode)
227227
}
228228
latex_tasks = [task for task in tasks if has_mark(task, "latex")]
@@ -255,7 +255,7 @@ def _add_latex_dependencies_retroactively(
255255
# Scan the LaTeX document for included files.
256256
try:
257257
scanned_deps = set(
258-
lds.scan(task.depends_on["_path_to_tex"].path) # type: ignore[attr-defined]
258+
lds.scan(task.depends_on["_path_to_tex"].path) # type: ignore[arg-type]
259259
)
260260
except Exception: # noqa: BLE001
261261
warnings.warn(
@@ -265,8 +265,10 @@ def _add_latex_dependencies_retroactively(
265265

266266
# Remove duplicated dependencies which have already been added by the user and those
267267
# which do not exist.
268-
task_deps = {
269-
i.path for i in tree_leaves(task.depends_on) if isinstance(i, PPathNode)
268+
task_deps = { # type: ignore[var-annotated]
269+
i.path
270+
for i in tree_leaves(task.depends_on) # type: ignore[arg-type]
271+
if isinstance(i, PPathNode)
270272
}
271273
additional_deps = scanned_deps - task_deps
272274
new_deps = [i for i in additional_deps if i in all_products or i.exists()]
@@ -287,9 +289,9 @@ def _add_latex_dependencies_retroactively(
287289
task_name=task.name,
288290
),
289291
),
290-
new_deps,
292+
new_deps, # type: ignore[arg-type]
291293
)
292-
task.depends_on["_scanned_dependencies"] = collected_dependencies
294+
task.depends_on["_scanned_dependencies"] = collected_dependencies # type: ignore[assignment]
293295

294296
# Mark the task as being delayed to avoid conflicts with unmatched dependencies.
295297
task.markers.append(Mark("try_last", (), {}))

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ def invoke(self, *args, **kwargs):
8585
return super().invoke(*args, **kwargs)
8686

8787

88-
@pytest.fixture()
88+
@pytest.fixture
8989
def runner():
9090
return CustomCliRunner()

tests/test_collect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from contextlib import ExitStack as does_not_raise # noqa: N813
44

55
import pytest
6+
67
from pytask_latex.collect import latex
78

89

9-
@pytest.mark.unit()
10+
@pytest.mark.unit
1011
@pytest.mark.parametrize(
1112
("kwargs", "expectation", "expected"),
1213
[

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pytask import build
55

66

7-
@pytest.mark.end_to_end()
7+
@pytest.mark.end_to_end
88
def test_marker_is_configured(tmp_path):
99
session = build(paths=tmp_path)
1010
assert "latex" in session.config["markers"]

tests/test_execute.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from pytask import Task
1010
from pytask import build
1111
from pytask import cli
12-
from pytask_latex.execute import pytask_execute_task_setup
1312

13+
from pytask_latex.execute import pytask_execute_task_setup
1414
from tests.conftest import TEST_RESOURCES
1515
from tests.conftest import needs_latexmk
1616
from tests.conftest import skip_on_github_actions_with_win
1717

1818

19-
@pytest.mark.unit()
19+
@pytest.mark.unit
2020
def test_pytask_execute_task_setup(monkeypatch):
2121
"""Make sure that the task setup raises errors."""
2222
# Act like latexmk is installed since we do not test this.
@@ -33,7 +33,7 @@ def test_pytask_execute_task_setup(monkeypatch):
3333

3434
@needs_latexmk
3535
@skip_on_github_actions_with_win
36-
@pytest.mark.end_to_end()
36+
@pytest.mark.end_to_end
3737
def test_compile_latex_document(runner, tmp_path):
3838
"""Test simple compilation."""
3939
task_source = """
@@ -59,7 +59,7 @@ def task_compile_document():
5959

6060
@needs_latexmk
6161
@skip_on_github_actions_with_win
62-
@pytest.mark.end_to_end()
62+
@pytest.mark.end_to_end
6363
def test_compile_latex_document_w_relative(runner, tmp_path):
6464
"""Test simple compilation."""
6565
task_source = f"""
@@ -91,7 +91,7 @@ def task_compile_document():
9191

9292
@needs_latexmk
9393
@skip_on_github_actions_with_win
94-
@pytest.mark.end_to_end()
94+
@pytest.mark.end_to_end
9595
def test_compile_latex_document_to_different_name(runner, tmp_path):
9696
"""Compile a LaTeX document where source and output name differ."""
9797
task_source = """
@@ -118,7 +118,7 @@ def task_compile_document():
118118

119119
@needs_latexmk
120120
@skip_on_github_actions_with_win
121-
@pytest.mark.end_to_end()
121+
@pytest.mark.end_to_end
122122
def test_compile_w_bibliography(runner, tmp_path):
123123
"""Compile a LaTeX document with bibliography."""
124124
task_source = """
@@ -158,7 +158,7 @@ def task_compile_document():
158158

159159
@needs_latexmk
160160
@skip_on_github_actions_with_win
161-
@pytest.mark.end_to_end()
161+
@pytest.mark.end_to_end
162162
def test_raise_error_if_latexmk_is_not_found(tmp_path, monkeypatch):
163163
task_source = """
164164
from pytask import mark
@@ -192,7 +192,7 @@ def task_compile_document():
192192

193193
@needs_latexmk
194194
@skip_on_github_actions_with_win
195-
@pytest.mark.end_to_end()
195+
@pytest.mark.end_to_end
196196
def test_compile_latex_document_w_xelatex(runner, tmp_path):
197197
task_source = """
198198
from pytask import mark
@@ -227,7 +227,7 @@ def task_compile_document():
227227

228228
@needs_latexmk
229229
@skip_on_github_actions_with_win
230-
@pytest.mark.end_to_end()
230+
@pytest.mark.end_to_end
231231
def test_compile_latex_document_w_two_dependencies(runner, tmp_path):
232232
task_source = """
233233
from pytask import mark
@@ -255,7 +255,7 @@ def task_compile_document(path: Path = Path("in.txt")):
255255

256256
@needs_latexmk
257257
@skip_on_github_actions_with_win
258-
@pytest.mark.end_to_end()
258+
@pytest.mark.end_to_end
259259
def test_fail_because_script_is_not_latex(tmp_path):
260260
task_source = """
261261
from pytask import mark
@@ -283,7 +283,7 @@ def task_compile_document(path: Path = Path("in.txt")):
283283

284284
@needs_latexmk
285285
@skip_on_github_actions_with_win
286-
@pytest.mark.end_to_end()
286+
@pytest.mark.end_to_end
287287
def test_compile_document_to_out_if_document_has_relative_resources(tmp_path):
288288
"""Test that motivates the ``"--cd"`` flag.
289289
@@ -326,7 +326,7 @@ def task_compile_document(path: Path = Path("resources/content.tex")):
326326

327327
@needs_latexmk
328328
@skip_on_github_actions_with_win
329-
@pytest.mark.end_to_end()
329+
@pytest.mark.end_to_end
330330
def test_compile_document_w_wrong_flag(tmp_path):
331331
"""Test that wrong flags raise errors."""
332332
tmp_path.joinpath("sub").mkdir(parents=True)
@@ -361,7 +361,7 @@ def task_compile_document():
361361

362362

363363
@needs_latexmk
364-
@pytest.mark.end_to_end()
364+
@pytest.mark.end_to_end
365365
def test_compile_document_w_image(runner, tmp_path):
366366
task_source = f"""
367367
from pytask import Product
@@ -397,7 +397,7 @@ def task_compile_document():
397397

398398
@needs_latexmk
399399
@skip_on_github_actions_with_win
400-
@pytest.mark.end_to_end()
400+
@pytest.mark.end_to_end
401401
def test_compile_latex_document_w_multiple_marks(runner, tmp_path):
402402
"""Test simple compilation."""
403403
task_source = """
@@ -425,7 +425,7 @@ def task_compile_document():
425425

426426
@needs_latexmk
427427
@skip_on_github_actions_with_win
428-
@pytest.mark.end_to_end()
428+
@pytest.mark.end_to_end
429429
def test_compile_latex_document_with_wrong_extension(runner, tmp_path):
430430
"""Test simple compilation."""
431431
task_source = """
@@ -452,7 +452,7 @@ def task_compile_document():
452452

453453
@needs_latexmk
454454
@skip_on_github_actions_with_win
455-
@pytest.mark.end_to_end()
455+
@pytest.mark.end_to_end
456456
def test_compile_w_bibliography_and_keep_bbl(runner, tmp_path):
457457
"""Compile a LaTeX document with bibliography."""
458458
task_source = """
@@ -496,7 +496,7 @@ def task_compile_document(
496496

497497
@needs_latexmk
498498
@skip_on_github_actions_with_win
499-
@pytest.mark.end_to_end()
499+
@pytest.mark.end_to_end
500500
@pytest.mark.parametrize(
501501
("step", "message"),
502502
[
@@ -536,7 +536,7 @@ def task_compile_document():
536536

537537
@needs_latexmk
538538
@skip_on_github_actions_with_win
539-
@pytest.mark.end_to_end()
539+
@pytest.mark.end_to_end
540540
def test_compile_latex_document_with_task_decorator(runner, tmp_path):
541541
"""Test simple compilation."""
542542
task_source = """
@@ -563,7 +563,7 @@ def compile_document():
563563

564564
@needs_latexmk
565565
@skip_on_github_actions_with_win
566-
@pytest.mark.end_to_end()
566+
@pytest.mark.end_to_end
567567
def test_use_task_without_path(tmp_path):
568568
task_source = """
569569
import pytask
@@ -591,7 +591,7 @@ def test_use_task_without_path(tmp_path):
591591

592592
@needs_latexmk
593593
@skip_on_github_actions_with_win
594-
@pytest.mark.end_to_end()
594+
@pytest.mark.end_to_end
595595
def test_collect_latex_document_with_product_from_another_task(runner, tmp_path):
596596
"""Test simple compilation."""
597597
task_source = """

tests/test_latex_dependency_scanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@needs_latexmk
1414
@skip_on_github_actions_with_win
15-
@pytest.mark.end_to_end()
15+
@pytest.mark.end_to_end
1616
@pytest.mark.parametrize("infer_dependencies", ["true", "false"])
1717
def test_infer_dependencies_from_task(tmp_path, infer_dependencies):
1818
task_source = """

tests/test_parallel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@xfail_on_remote
3333
@needs_latexmk
3434
@skip_on_github_actions_with_win
35-
@pytest.mark.end_to_end()
35+
@pytest.mark.end_to_end
3636
def test_parallel_parametrization_over_source_files_w_loop(runner, tmp_path):
3737
source = """
3838
from pytask import mark, task
@@ -68,7 +68,7 @@ def task_compile_latex_document():
6868
@xfail_on_remote
6969
@needs_latexmk
7070
@skip_on_github_actions_with_win
71-
@pytest.mark.end_to_end()
71+
@pytest.mark.end_to_end
7272
def test_parallel_parametrization_over_source_file_w_loop(runner, tmp_path):
7373
source = """
7474
from pytask import mark, task

tests/test_parametrize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@needs_latexmk
1414
@skip_on_github_actions_with_win
15-
@pytest.mark.end_to_end()
15+
@pytest.mark.end_to_end
1616
def test_parametrized_compilation_of_latex_documents_w_loop(tmp_path):
1717
source = """
1818
from pytask import mark, task
@@ -48,7 +48,7 @@ def task_compile_latex_document():
4848

4949
@needs_latexmk
5050
@skip_on_github_actions_with_win
51-
@pytest.mark.end_to_end()
51+
@pytest.mark.end_to_end
5252
def test_parametrizing_latex_options_w_loop(tmp_path):
5353
source = """
5454
from pytask import mark, task

0 commit comments

Comments
 (0)