Skip to content

Commit c2ab620

Browse files
authored
Merge branch 'main' into fix-79
2 parents 306749b + 37c3040 commit c2ab620

File tree

15 files changed

+53
-51
lines changed

15 files changed

+53
-51
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

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
45-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
45+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
4646

4747
steps:
4848
- uses: actions/checkout@v4

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
name: python-package-distributions
6868
path: dist/
6969
- name: Sign the dists with Sigstore
70-
uses: sigstore/gh-action-sigstore-python@v2.1.1
70+
uses: sigstore/gh-action-sigstore-python@v3.0.0
7171
with:
7272
inputs: >-
7373
./dist/*.tar.gz

.pre-commit-config.yaml

Lines changed: 4 additions & 8 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,12 @@ 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
33-
- repo: https://github.com/dosisod/refurb
34-
rev: v2.0.0
35-
hooks:
36-
- id: refurb
3733
- repo: https://github.com/executablebooks/mdformat
38-
rev: 0.7.17
34+
rev: 0.7.22
3935
hooks:
4036
- id: mdformat
4137
additional_dependencies: [
@@ -44,7 +40,7 @@ repos:
4440
]
4541
args: [--wrap, "88"]
4642
- repo: https://github.com/codespell-project/codespell
47-
rev: v2.2.6
43+
rev: v2.4.1
4844
hooks:
4945
- id: codespell
5046
args: [-L als, -L falsy]

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ This is a record of all past pytask-latex releases and what went into them in re
44
chronological order. Releases follow [semantic versioning](https://semver.org/) and all
55
releases are available on [Anaconda.org](https://anaconda.org/conda-forge/pytask-latex).
66

7-
## 0.4.3 - 2024-xx-xx
7+
## 0.4.3 - 2025-06-xx
88

99
- {pull}`75` adds rye.
10+
- {pull}`81` adds support for Python 3.13 and drops support for Python 3.8.
1011

1112
## 0.4.2 - 2023-11-30
1213

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ classifiers = [
1212
"Programming Language :: Python :: 3",
1313
"Programming Language :: Python :: 3 :: Only",
1414
]
15-
requires-python = ">=3.8"
15+
requires-python = ">=3.9"
1616
dependencies = [
1717
"latex-dependency-scanner>=0.1.3",
1818
"pluggy>=1.0.0",
@@ -72,7 +72,6 @@ disallow_untyped_defs = false
7272
ignore_errors = true
7373

7474
[tool.ruff]
75-
target-version = "py38"
7675
fix = true
7776
unsafe-fixes = true
7877

src/pytask_latex/collect.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import warnings
66
from pathlib import Path
77
from subprocess import CalledProcessError
8+
from typing import TYPE_CHECKING
89
from typing import Any
910
from typing import Callable
10-
from typing import Sequence
1111

1212
import latex_dependency_scanner as lds
1313
from pytask import Mark
@@ -33,6 +33,9 @@
3333
from pytask_latex import compilation_steps as cs
3434
from pytask_latex.utils import to_list
3535

36+
if TYPE_CHECKING:
37+
from collections.abc import Sequence
38+
3639

3740
def latex(
3841
*,
@@ -219,10 +222,10 @@ def pytask_collect_task(
219222
def pytask_collect_modify_tasks(session: Session, tasks: list[PTask]) -> None:
220223
"""Add dependencies from from LaTeX documents to tasks."""
221224
if session.config["infer_latex_dependencies"]:
222-
all_products = {
225+
all_products = { # type: ignore[var-annotated]
223226
product.path
224227
for task in tasks
225-
for product in tree_leaves(task.produces)
228+
for product in tree_leaves(task.produces) # type: ignore[arg-type]
226229
if isinstance(product, PPathNode)
227230
}
228231
latex_tasks = [task for task in tasks if has_mark(task, "latex")]
@@ -255,7 +258,7 @@ def _add_latex_dependencies_retroactively(
255258
# Scan the LaTeX document for included files.
256259
try:
257260
scanned_deps = set(
258-
lds.scan(task.depends_on["_path_to_tex"].path) # type: ignore[attr-defined]
261+
lds.scan(task.depends_on["_path_to_tex"].path) # type: ignore[arg-type]
259262
)
260263
except Exception: # noqa: BLE001
261264
warnings.warn(
@@ -265,8 +268,10 @@ def _add_latex_dependencies_retroactively(
265268

266269
# Remove duplicated dependencies which have already been added by the user and those
267270
# which do not exist.
268-
task_deps = {
269-
i.path for i in tree_leaves(task.depends_on) if isinstance(i, PPathNode)
271+
task_deps = { # type: ignore[var-annotated]
272+
i.path
273+
for i in tree_leaves(task.depends_on) # type: ignore[arg-type]
274+
if isinstance(i, PPathNode)
270275
}
271276
additional_deps = scanned_deps - task_deps
272277
new_deps = [i for i in additional_deps if i in all_products or i.exists()]
@@ -287,9 +292,9 @@ def _add_latex_dependencies_retroactively(
287292
task_name=task.name,
288293
),
289294
),
290-
new_deps,
295+
new_deps, # type: ignore[arg-type]
291296
)
292-
task.depends_on["_scanned_dependencies"] = collected_dependencies
297+
task.depends_on["_scanned_dependencies"] = collected_dependencies # type: ignore[assignment]
293298

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

src/pytask_latex/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5+
from collections.abc import Sequence
56
from typing import Any
6-
from typing import Sequence
77

88

99
def to_list(scalar_or_iter: Any) -> list[Any]:

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
[

0 commit comments

Comments
 (0)