Skip to content
Merged
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
9 changes: 3 additions & 6 deletions .github/workflows/run-tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ jobs:
- name: Get current month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
- name: Cache APT Packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: poppler-utils imagemagick
version: 1.0
execute_install_scripts: true
- name: Install APT Packages
run: |
sudo apt-get install -y poppler-utils imagemagick
- name: Cache tox and precommit environments
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
25 changes: 9 additions & 16 deletions dir_content_diff/base_comparators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Module containing the base comparators."""

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

kwargs["tempdir"] = new_tempdir

# Update default verbosity
current_default_verbosity = diff_pdf_visually.constants.DEFAULT_VERBOSITY
try:
# Update default verbosity
if "verbosity" not in kwargs: # pragma: no branch
current_default_verbosity = int(
diff_pdf_visually.constants.DEFAULT_VERBOSITY
)
try:
if (
diff_pdf_visually.diff.pdfdiff_pages.__defaults__[1] is None
): # pragma: no cover
diff_pdf_visually.constants.DEFAULT_VERBOSITY = 0
else:
kwargs["verbosity"] = 0
finally:
diff_pdf_visually.constants.DEFAULT_VERBOSITY = (
current_default_verbosity
)
if (
diff_pdf_visually.diff.pdfdiff_pages.__defaults__[1] is None
): # pragma: no cover
diff_pdf_visually.constants.DEFAULT_VERBOSITY = 0
else:
kwargs["verbosity"] = 0 # pragma: no cover
return super().__call__(ref_file, comp_file, *args, **kwargs)
finally:
diff_pdf_visually.constants.DEFAULT_VERBOSITY = current_default_verbosity
Expand Down
4 changes: 2 additions & 2 deletions dir_content_diff/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Main entry point of the Command Line Interface for the dir-content-diff package."""

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


@click.command(
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/comparators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Sub-package of dir-content-diff for specific comparators."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/comparators/morphio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Extension module to process morphology files with MorphIO and morph-tool."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/comparators/pandas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Extension module to process files with Pandas."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/comparators/voxcell.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Extension module to process files with Voxcell."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion dir_content_diff/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Some utils used by the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Configuration file for the Sphinx documentation builder."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Setup for the dir-content-diff package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests suite for the dir-content-diff package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/comparators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests suite for the dir-content-diff.comparators sub-package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/comparators/test_morphio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the MorphIO extension of the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/comparators/test_pandas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the Pandas extension of the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/comparators/test_voxcell.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the Voxcell extension of the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Configuration for the pytest test suite."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down Expand Up @@ -84,7 +84,7 @@ def pdf_diff():
"""The diff that should be reported for the PDF files."""
return (
r"The files '\S*/file.pdf' and '\S*/file.pdf' are different\:\n"
"Kwargs used for computing differences: {'verbosity': 0}\n"
r"(Kwargs used for computing differences: {'verbosity': 0}\n)?"
"The following pages are the most different: 1"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/generate_test_files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Function to create base files used for tests."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the base features of the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down Expand Up @@ -1205,7 +1205,7 @@ def test_nested_files(self, ref_with_nested_file, res_diff_with_nested_file):
match = re.match(
r"The files '\S*/ref/level1/level2/level3/file\.pdf' and "
r"'\S*/res/level1/level2/level3/file\.pdf' are different:\n"
"Kwargs used for computing differences: {'verbosity': 0}\n"
r"(Kwargs used for computing differences: {'verbosity': 0}\n)?"
"The following pages are the most different: 1",
res["level1/level2/level3/file.pdf"],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the CLI of the ``dir-content-diff`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_missing_deps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test comparators with missing deps."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pytest_plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the pytest plugin."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the ``dir-content-diff.util`` package."""

# LICENSE HEADER MANAGED BY add-license-header
# Copyright (c) 2023-2024 Blue Brain Project, EPFL.
# Copyright (c) 2023-2025 Blue Brain Project, EPFL.
#
# This file is part of dir-content-diff.
# See https://github.com/BlueBrain/dir-content-diff for further info.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test the version of the ``dir-content-diff`` package."""

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