From 047467676e96d6833087796a92c484b5760021dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:48:52 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.11.13](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.11.13) - [github.com/executablebooks/mdformat: 0.7.17 → 0.7.22](https://github.com/executablebooks/mdformat/compare/0.7.17...0.7.22) - [github.com/codespell-project/codespell: v2.2.6 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c58ef5..0758fb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files args: ['--maxkb=25'] @@ -25,12 +25,12 @@ repos: - id: python-use-type-annotations - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.11.13 hooks: - id: ruff - id: ruff-format - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.22 hooks: - id: mdformat additional_dependencies: [ @@ -40,7 +40,7 @@ repos: args: [--wrap, "88"] files: (README\.md) - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell - repo: meta From 1d466f65dbcb58a94ed7c9064b8ae7eebcd1a6f8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:49:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/latex_dependency_scanner/scanner.py | 2 +- tests/test_regex.py | 3 ++- tests/test_scan.py | 32 ++++++++++++------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/latex_dependency_scanner/scanner.py b/src/latex_dependency_scanner/scanner.py index fe6aa29..2ea75e2 100644 --- a/src/latex_dependency_scanner/scanner.py +++ b/src/latex_dependency_scanner/scanner.py @@ -39,7 +39,7 @@ r"(<[^<>]*>)?" r"(\[[^\[\]]*\])?" r"({(?P[^{}]*)})?{(?P[^{}]*)}", - re.M, + re.MULTILINE, ) """re.Pattern: The regular expression pattern to extract included files from a LaTeX document.""" diff --git a/tests/test_regex.py b/tests/test_regex.py index c037747..14bf3d5 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -3,10 +3,11 @@ from __future__ import annotations import pytest + from latex_dependency_scanner.scanner import REGEX_TEX -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("text", "expected"), [ diff --git a/tests/test_scan.py b/tests/test_scan.py index ecff6d7..37de330 100644 --- a/tests/test_scan.py +++ b/tests/test_scan.py @@ -4,16 +4,16 @@ import textwrap import pytest + from latex_dependency_scanner.compile import compile_pdf from latex_dependency_scanner.scanner import COMMON_GRAPHICS_EXTENSIONS from latex_dependency_scanner.scanner import scan - from tests.conftest import TEST_RESOURCES from tests.conftest import needs_latexmk @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_document_without_inclusions(tmp_path): source = r""" \documentclass{article} @@ -31,7 +31,7 @@ def test_document_without_inclusions(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize("directive", ["include", "input"]) def test_input_or_include(tmp_path, directive): source = f""" @@ -61,7 +61,7 @@ def test_input_or_include(tmp_path, directive): ] -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize("directive", ["include", "input"]) def test_input_or_include_without_extension_and_file(tmp_path, directive): source = f""" @@ -83,7 +83,7 @@ def test_input_or_include_without_extension_and_file(tmp_path, directive): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize("image_ext", COMMON_GRAPHICS_EXTENSIONS) @pytest.mark.parametrize("has_extension", [True, False]) @pytest.mark.parametrize("file_exists", [True, False]) @@ -108,7 +108,7 @@ def test_includegraphics(tmp_path, image_ext, has_extension, file_exists): \\documentclass{{article}} \\usepackage{{graphicx}} \\begin{{document}} - \\includegraphics{{image{image_ext if has_extension else ''}}} + \\includegraphics{{image{image_ext if has_extension else ""}}} \\end{{document}} """ tmp_path.joinpath("document.tex").write_text(textwrap.dedent(source)) @@ -138,7 +138,7 @@ def test_includegraphics(tmp_path, image_ext, has_extension, file_exists): assert nodes == expected -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_includegraphics_with_beamer_overlay(tmp_path): source = r""" \documentclass{beamer} @@ -157,7 +157,7 @@ def test_includegraphics_with_beamer_overlay(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_import(tmp_path): source = """ \\documentclass{article} @@ -185,7 +185,7 @@ def test_import(tmp_path): ] -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_import_without_extension_and_file(tmp_path): source = """ \\documentclass{article} @@ -205,7 +205,7 @@ def test_import_without_extension_and_file(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_sub_import(tmp_path): source = """ \\documentclass{article} @@ -235,7 +235,7 @@ def test_sub_import(tmp_path): ] -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_sub_import_without_extension_and_file(tmp_path): source = """ \\documentclass{article} @@ -261,7 +261,7 @@ def test_sub_import_without_extension_and_file(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_mixed_import_and_subimport(tmp_path): """Test document with mixed import and subimport directives. @@ -314,7 +314,7 @@ def test_mixed_import_and_subimport(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_natbib_bibliography(tmp_path): source = """ \\documentclass{article} @@ -335,7 +335,7 @@ def test_natbib_bibliography(tmp_path): assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"] -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_natbib_bibliography_without_extension_and_file(tmp_path): source = """ \\documentclass{article} @@ -354,7 +354,7 @@ def test_natbib_bibliography_without_extension_and_file(tmp_path): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_biblatex_bibliography(tmp_path): """Test document with biblatex bibliography.""" source = """ @@ -376,7 +376,7 @@ def test_biblatex_bibliography(tmp_path): assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"] -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_biblatex_bibliography_without_extension_and_file(tmp_path): """Test document without biblatex bibliography file and extension.""" source = """