Skip to content

Commit 73da7fc

Browse files
[pre-commit.ci] pre-commit autoupdate (#69)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <raabe@posteo.de>
1 parent a923fbe commit 73da7fc

14 files changed

+33
-44
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ __pycache__
1212

1313
*.egg-info
1414

15-
.pytask.sqlite3
16-
1715
build
1816
dist
1917
src/pytask_latex/_version.py
18+
.pytask

.pre-commit-config.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@ repos:
2525
- id: python-no-log-warn
2626
- id: python-use-type-annotations
2727
- id: text-unicode-replacement-char
28-
- repo: https://github.com/asottile/reorder-python-imports
29-
rev: v3.12.0
30-
hooks:
31-
- id: reorder-python-imports
32-
args: [--py38-plus, --add-import, 'from __future__ import annotations']
3328
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: v0.1.6
29+
rev: v0.2.2
3530
hooks:
3631
- id: ruff
3732
- id: ruff-format
3833
- repo: https://github.com/dosisod/refurb
39-
rev: v1.24.0
34+
rev: v1.28.0
4035
hooks:
4136
- id: refurb
4237
- repo: https://github.com/executablebooks/mdformat
@@ -54,7 +49,7 @@ repos:
5449
- id: codespell
5550
args: [-L als, -L falsy]
5651
- repo: https://github.com/pre-commit/mirrors-mypy
57-
rev: 'v1.7.1'
52+
rev: 'v1.8.0'
5853
hooks:
5954
- id: mypy
6055
additional_dependencies: [

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ use-cases automatically. The following is equivalent to a bare `@mark.latex` dec
9494
document=Path("document.pdf"),
9595
compilation_steps="latexmk",
9696
)
97-
def task_compile_latex_document():
98-
...
97+
def task_compile_latex_document(): ...
9998
```
10099

101100
The `@mark.latex` decorator has a keyword argument called `compilation_steps` which
@@ -114,8 +113,7 @@ from pytask_latex import compilation_steps as cs
114113
options=("--pdf", "--interaction=nonstopmode", "--synctex=1", "--cd")
115114
),
116115
)
117-
def task_compile_latex_document():
118-
...
116+
def task_compile_latex_document(): ...
119117
```
120118

121119
In this example, `compilation_steps.latexmk` is a compilation step constructor which
@@ -132,8 +130,7 @@ an example for generating a `.dvi`.
132130
options=("--dvi", "--interaction=nonstopmode", "--synctex=1", "--cd")
133131
),
134132
)
135-
def task_compile_latex_document():
136-
...
133+
def task_compile_latex_document(): ...
137134
```
138135

139136
`compilation_step.latexmk(options)` generates a compilation step which is a function

pyproject.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"]
33
build-backend = "setuptools.build_meta"
44

5-
65
[project]
76
name = "pytask_latex"
87
description = "Compile LaTeX documents with pytask."
@@ -49,11 +48,9 @@ pytask_latex = "pytask_latex.plugin"
4948
where = [ "src" ]
5049
namespaces = false
5150

52-
5351
[tool.setuptools_scm]
5452
write_to = "src/pytask_latex/_version.py"
5553

56-
5754
[tool.mypy]
5855
files = ["src", "tests"]
5956
check_untyped_defs = true
@@ -64,37 +61,36 @@ no_implicit_optional = true
6461
warn_redundant_casts = true
6562
warn_unused_ignores = true
6663

67-
6864
[[tool.mypy.overrides]]
6965
module = "tests.*"
7066
disallow_untyped_defs = false
7167
ignore_errors = true
7268

73-
7469
[tool.ruff]
7570
target-version = "py38"
76-
select = ["ALL"]
7771
fix = true
7872
unsafe-fixes = true
73+
74+
[tool.ruff.lint]
7975
extend-ignore = [
8076
# Others.
81-
"I", # ignore isort
8277
"ANN101", # type annotating self
8378
"ANN102", # type annotating cls
8479
"ANN401", # Allow typing.Any.
8580
"COM812", # Comply with ruff-format
8681
"ISC001", # Comply with ruff-format
8782
]
83+
select = ["ALL"]
8884

89-
90-
[tool.ruff.per-file-ignores]
85+
[tool.ruff.lint.per-file-ignores]
9186
"tests/*" = ["D", "ANN", "PLR2004", "S101"]
9287

88+
[tool.ruff.lint.isort]
89+
force-single-line = true
9390

94-
[tool.ruff.pydocstyle]
91+
[tool.ruff.lint.pydocstyle]
9592
convention = "numpy"
9693

97-
9894
[tool.pytest.ini_options]
9995
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
10096
testpaths = ["src", "tests"]

src/pytask_latex/collect.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,26 @@
99
from typing import Sequence
1010

1111
import latex_dependency_scanner as lds
12-
from pytask import has_mark
13-
from pytask import hookimpl
14-
from pytask import is_task_function
1512
from pytask import Mark
1613
from pytask import NodeInfo
1714
from pytask import NodeNotCollectedError
18-
from pytask import parse_dependencies_from_task_function
19-
from pytask import parse_products_from_task_function
2015
from pytask import PathNode
2116
from pytask import PNode
2217
from pytask import PPathNode
2318
from pytask import PTask
2419
from pytask import PTaskWithPath
25-
from pytask import remove_marks
2620
from pytask import Session
2721
from pytask import Task
2822
from pytask import TaskWithoutPath
23+
from pytask import has_mark
24+
from pytask import hookimpl
25+
from pytask import is_task_function
26+
from pytask import parse_dependencies_from_task_function
27+
from pytask import parse_products_from_task_function
28+
from pytask import remove_marks
2929
from pytask.tree_util import tree_leaves
3030
from pytask.tree_util import tree_map
31+
3132
from pytask_latex import compilation_steps as cs
3233
from pytask_latex.utils import to_list
3334

src/pytask_latex/compilation_steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def compilation_step(path_to_tex: Path, path_to_document: Path):
1313
from __future__ import annotations
1414

1515
import subprocess
16+
from typing import TYPE_CHECKING
1617
from typing import Any
1718
from typing import Callable
18-
from typing import TYPE_CHECKING
1919

2020
from pytask_latex.path import relative_to
2121
from pytask_latex.utils import to_list

src/pytask_latex/execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import shutil
55

6+
from pytask import PTask
67
from pytask import has_mark
78
from pytask import hookimpl
8-
from pytask import PTask
99

1010

1111
@hookimpl

src/pytask_latex/plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import TYPE_CHECKING
55

66
from pytask import hookimpl
7+
78
from pytask_latex import collect
89
from pytask_latex import config
910
from pytask_latex import execute

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import pytest
1212
from click.testing import CliRunner
13-
13+
from pytask import storage
1414

1515
TEST_RESOURCES = Path(__file__).parent / "resources"
1616

@@ -79,6 +79,7 @@ def _restore_sys_path_and_module_after_test_execution():
7979
class CustomCliRunner(CliRunner):
8080
def invoke(self, *args, **kwargs):
8181
"""Restore sys.path and sys.modules after an invocation."""
82+
storage.create()
8283
with restore_sys_path_and_module_after_test_execution():
8384
return super().invoke(*args, **kwargs)
8485

tests/test_execute.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
from pathlib import Path
55

66
import pytest
7-
from pytask import build
8-
from pytask import cli
97
from pytask import ExitCode
108
from pytask import Mark
119
from pytask import Task
10+
from pytask import build
11+
from pytask import cli
1212
from pytask_latex.execute import pytask_execute_task_setup
1313

14+
from tests.conftest import TEST_RESOURCES
1415
from tests.conftest import needs_latexmk
1516
from tests.conftest import skip_on_github_actions_with_win
16-
from tests.conftest import TEST_RESOURCES
1717

1818

1919
@pytest.mark.unit()

0 commit comments

Comments
 (0)