Skip to content

[pre-commit.ci] pre-commit autoupdate #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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.12
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: [
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/latex_dependency_scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
r"(<[^<>]*>)?"
r"(\[[^\[\]]*\])?"
r"({(?P<relative_to>[^{}]*)})?{(?P<file>[^{}]*)}",
re.M,
re.MULTILINE,
)
"""re.Pattern: The regular expression pattern to extract included files from a LaTeX
document."""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
[
Expand Down
32 changes: 16 additions & 16 deletions tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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"""
Expand Down Expand Up @@ -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"""
Expand All @@ -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])
Expand All @@ -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))
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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.

Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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 = """
Expand All @@ -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 = """
Expand Down
Loading