Skip to content

Commit 7e172e4

Browse files
Fix: Properly update the verbosity in PDF comparator (#75)
* Test: Fix expected results for diff-pdf-visually>=1.8.1 * Fix: Properly update the verbosity in PDF comparator * CI: Drop APT cache * Chore: Update licence headers
1 parent 86d0d9d commit 7e172e4

25 files changed

+38
-48
lines changed

.github/workflows/run-tox.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@ jobs:
3030
- name: Get current month
3131
id: date
3232
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
33-
- name: Cache APT Packages
34-
uses: awalsh128/cache-apt-pkgs-action@latest
35-
with:
36-
packages: poppler-utils imagemagick
37-
version: 1.0
38-
execute_install_scripts: true
33+
- name: Install APT Packages
34+
run: |
35+
sudo apt-get install -y poppler-utils imagemagick
3936
- name: Cache tox and precommit environments
4037
uses: actions/cache@v4
4138
with:

dir_content_diff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
# LICENSE HEADER MANAGED BY add-license-header
7-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
7+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
88
#
99
# This file is part of dir-content-diff.
1010
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/base_comparators.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Module containing the base comparators."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.
@@ -665,23 +665,16 @@ def __call__(self, ref_file, comp_file, *args, **kwargs):
665665

666666
kwargs["tempdir"] = new_tempdir
667667

668+
# Update default verbosity
669+
current_default_verbosity = diff_pdf_visually.constants.DEFAULT_VERBOSITY
668670
try:
669-
# Update default verbosity
670671
if "verbosity" not in kwargs: # pragma: no branch
671-
current_default_verbosity = int(
672-
diff_pdf_visually.constants.DEFAULT_VERBOSITY
673-
)
674-
try:
675-
if (
676-
diff_pdf_visually.diff.pdfdiff_pages.__defaults__[1] is None
677-
): # pragma: no cover
678-
diff_pdf_visually.constants.DEFAULT_VERBOSITY = 0
679-
else:
680-
kwargs["verbosity"] = 0
681-
finally:
682-
diff_pdf_visually.constants.DEFAULT_VERBOSITY = (
683-
current_default_verbosity
684-
)
672+
if (
673+
diff_pdf_visually.diff.pdfdiff_pages.__defaults__[1] is None
674+
): # pragma: no cover
675+
diff_pdf_visually.constants.DEFAULT_VERBOSITY = 0
676+
else:
677+
kwargs["verbosity"] = 0 # pragma: no cover
685678
return super().__call__(ref_file, comp_file, *args, **kwargs)
686679
finally:
687680
diff_pdf_visually.constants.DEFAULT_VERBOSITY = current_default_verbosity

dir_content_diff/cli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Main entry point of the Command Line Interface for the dir-content-diff package."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.
@@ -63,7 +63,7 @@ def load_config(ctx, param, value): # pylint: disable=unused-argument
6363
"Could not load the configuration because it could not be parsed as a JSON "
6464
"string nor as a YAML file."
6565
)
66-
raise SyntaxError(msg)
66+
raise SyntaxError(msg) from None
6767

6868

6969
@click.command(

dir_content_diff/comparators/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sub-package of dir-content-diff for specific comparators."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/comparators/morphio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Extension module to process morphology files with MorphIO and morph-tool."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/comparators/pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Extension module to process files with Pandas."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/comparators/voxcell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Extension module to process files with Voxcell."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/pytest_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""
1414

1515
# LICENSE HEADER MANAGED BY add-license-header
16-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
16+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
1717
#
1818
# This file is part of dir-content-diff.
1919
# See https://github.com/BlueBrain/dir-content-diff for further info.

dir_content_diff/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Some utils used by the ``dir-content-diff`` package."""
22

33
# LICENSE HEADER MANAGED BY add-license-header
4-
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
4+
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
55
#
66
# This file is part of dir-content-diff.
77
# See https://github.com/BlueBrain/dir-content-diff for further info.

0 commit comments

Comments
 (0)