Skip to content

Commit eef375c

Browse files
[pre-commit.ci] pre-commit autoupdate (#54)
1 parent 77f713f commit eef375c

File tree

7 files changed

+31
-59
lines changed

7 files changed

+31
-59
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,16 @@ repos:
3434
rev: v2.2.0
3535
hooks:
3636
- id: setup-cfg-fmt
37-
- repo: https://github.com/PyCQA/docformatter
38-
rev: v1.5.1
39-
hooks:
40-
- id: docformatter
41-
args: [--in-place, --wrap-summaries, "88", --wrap-descriptions, "88", --blank]
4237
- repo: https://github.com/psf/black
43-
rev: 22.12.0
38+
rev: 23.3.0
4439
hooks:
4540
- id: black
46-
- repo: https://github.com/asottile/blacken-docs
47-
rev: 1.13.0
48-
hooks:
49-
- id: blacken-docs
50-
additional_dependencies: [black]
5141
- repo: https://github.com/charliermarsh/ruff-pre-commit
52-
rev: v0.0.223
42+
rev: v0.0.261
5343
hooks:
5444
- id: ruff
5545
- repo: https://github.com/dosisod/refurb
56-
rev: v1.10.0
46+
rev: v1.15.0
5747
hooks:
5848
- id: refurb
5949
args: [--ignore, FURB126]
@@ -72,12 +62,12 @@ repos:
7262
]
7363
args: [--wrap, "88"]
7464
- repo: https://github.com/codespell-project/codespell
75-
rev: v2.2.2
65+
rev: v2.2.4
7666
hooks:
7767
- id: codespell
7868
args: [-L als, -L falsy]
7969
- repo: https://github.com/pre-commit/mirrors-mypy
80-
rev: 'v0.991'
70+
rev: 'v1.2.0'
8171
hooks:
8272
- id: mypy
8373
args: [

environment.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ dependencies:
2424
- pytest
2525
- pytest-cov
2626
- pytest-xdist
27+
28+
- pip:
29+
- -e .

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ target-version = "py37"
2929
select = ["ALL"]
3030
fix = true
3131
extend-ignore = [
32+
"TCH",
33+
"TRY",
3234
# Numpy docstyle
3335
"D107",
3436
"D203",
@@ -61,3 +63,15 @@ extend-ignore = [
6163

6264
[tool.ruff.pydocstyle]
6365
convention = "numpy"
66+
67+
68+
[tool.pytest.ini_options]
69+
# Do not add src since it messes with the loading of pytask-parallel as a plugin.
70+
testpaths = ["test"]
71+
markers = [
72+
"wip: Tests that are work-in-progress.",
73+
"unit: Flag for unit tests which target mainly a single function.",
74+
"integration: Flag for integration tests which may comprise of multiple unit tests.",
75+
"end_to_end: Flag for tests that cover the whole program.",
76+
]
77+
norecursedirs = [".idea", ".tox"]

src/pytask_latex/collect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ def pytask_collect_task(
122122
)
123123

124124
if not (
125-
isinstance(script_node, FilePathNode)
126-
and script_node.value.suffix == ".tex" # noqa: PLR2004
125+
isinstance(script_node, FilePathNode) and script_node.value.suffix == ".tex"
127126
):
128127
raise ValueError(
129128
"The 'script' keyword of the @pytask.mark.latex decorator must point "

src/pytask_latex/compilation_steps.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ def run_latexmk(path_to_tex: Path, path_to_document: Path) -> None:
3434
out_dir_opt = [
3535
f"--output-directory={relative_to(path_to_tex, path_to_document.parent)}"
3636
]
37-
cmd = (
38-
["latexmk", *options]
39-
+ job_name_opt
40-
+ out_dir_opt
41-
+ [path_to_tex.as_posix()]
42-
)
37+
cmd = ["latexmk", *options, *job_name_opt, *out_dir_opt] + [
38+
path_to_tex.as_posix()
39+
]
4340
subprocess.run(cmd, check=True)
4441

4542
return run_latexmk

src/pytask_latex/parametrize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
@hookimpl
1111
def pytask_parametrize_kwarg_to_marker(obj: Any, kwargs: dict[str, Any]) -> None:
1212
"""Register kwargs as latex marker."""
13-
if callable(obj) and "latex" in kwargs: # noqa: PLR2004
13+
if callable(obj) and "latex" in kwargs:
1414
pytask.mark.latex(**kwargs.pop("latex"))(obj)

tox.ini

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,20 @@
11
[tox]
22
envlist = pytest
3-
skipsdist = True
4-
skip_missing_interpreters = True
53

64
[testenv]
5+
usedevelop = true
76
passenv = CI
8-
basepython = python
97

108
[testenv:pytest]
9+
conda_channels =
10+
conda-forge
11+
nodefaults
1112
conda_deps =
1213
pytask >=0.3
1314
pytask-parallel >=0.3
1415
latex-dependency-scanner
1516
pytest
1617
pytest-cov
1718
pytest-xdist
18-
conda_channels =
19-
conda-forge
20-
nodefaults
2119
commands =
22-
pip install -e . --no-deps
2320
pytest {posargs}
24-
25-
[flake8]
26-
docstring-convention = numpy
27-
ignore =
28-
D
29-
E203 ; ignores whitespace around : which is enforced by Black.
30-
W503 ; ignores linebreak before binary operator which is enforced by Black.
31-
PT006 ; ignores that parametrizing tests with tuple argument names is preferred.
32-
PT023 ; ignores parentheses at the end of markers.
33-
max-line-length = 88
34-
warn-symbols =
35-
pytest.mark.wip = Remove 'wip' flag for tests.
36-
pytest.mark.skip = Remove 'skip' flag for tests.
37-
38-
[pytest]
39-
addopts = --doctest-modules
40-
filterwarnings =
41-
ignore: the imp module is deprecated in favour of importlib
42-
ignore: Using or importing the ABCs from 'collections'
43-
ignore: The (parser|symbol) module is deprecated and will be removed in future
44-
markers =
45-
wip: Tests that are work-in-progress.
46-
unit: Flag for unit tests which target mainly a single function.
47-
integration: Flag for integration tests which may comprise of multiple unit tests.
48-
end_to_end: Flag for tests that cover the whole program.
49-
norecursedirs =
50-
.idea
51-
.tox

0 commit comments

Comments
 (0)