diff --git a/.github/workflows/run-tox.yml b/.github/workflows/run-tox.yml index f876512..cdee4c2 100644 --- a/.github/workflows/run-tox.yml +++ b/.github/workflows/run-tox.yml @@ -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: diff --git a/dir_content_diff/__init__.py b/dir_content_diff/__init__.py index b9e06fb..f1aef29 100644 --- a/dir_content_diff/__init__.py +++ b/dir_content_diff/__init__.py @@ -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. diff --git a/dir_content_diff/base_comparators.py b/dir_content_diff/base_comparators.py index 0296eb4..83a81d2 100644 --- a/dir_content_diff/base_comparators.py +++ b/dir_content_diff/base_comparators.py @@ -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. @@ -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 diff --git a/dir_content_diff/cli/__init__.py b/dir_content_diff/cli/__init__.py index 00621a0..f5b0de9 100644 --- a/dir_content_diff/cli/__init__.py +++ b/dir_content_diff/cli/__init__.py @@ -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. @@ -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( diff --git a/dir_content_diff/comparators/__init__.py b/dir_content_diff/comparators/__init__.py index 8053f61..daea585 100644 --- a/dir_content_diff/comparators/__init__.py +++ b/dir_content_diff/comparators/__init__.py @@ -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. diff --git a/dir_content_diff/comparators/morphio.py b/dir_content_diff/comparators/morphio.py index 214b3d5..6e642ed 100644 --- a/dir_content_diff/comparators/morphio.py +++ b/dir_content_diff/comparators/morphio.py @@ -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. diff --git a/dir_content_diff/comparators/pandas.py b/dir_content_diff/comparators/pandas.py index 8a0762e..ee74607 100644 --- a/dir_content_diff/comparators/pandas.py +++ b/dir_content_diff/comparators/pandas.py @@ -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. diff --git a/dir_content_diff/comparators/voxcell.py b/dir_content_diff/comparators/voxcell.py index 6e9e841..6edf8b2 100644 --- a/dir_content_diff/comparators/voxcell.py +++ b/dir_content_diff/comparators/voxcell.py @@ -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. diff --git a/dir_content_diff/pytest_plugin.py b/dir_content_diff/pytest_plugin.py index 914125c..4a56432 100644 --- a/dir_content_diff/pytest_plugin.py +++ b/dir_content_diff/pytest_plugin.py @@ -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. diff --git a/dir_content_diff/util.py b/dir_content_diff/util.py index da81338..d9d7a84 100644 --- a/dir_content_diff/util.py +++ b/dir_content_diff/util.py @@ -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. diff --git a/docs/source/conf.py b/docs/source/conf.py index 2d7575b..e8131ba 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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. diff --git a/setup.py b/setup.py index 4243cfe..bbbce4d 100644 --- a/setup.py +++ b/setup.py @@ -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. diff --git a/tests/__init__.py b/tests/__init__.py index 29b1b2b..f364201 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -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. diff --git a/tests/comparators/__init__.py b/tests/comparators/__init__.py index 69c84f2..e38726b 100644 --- a/tests/comparators/__init__.py +++ b/tests/comparators/__init__.py @@ -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. diff --git a/tests/comparators/test_morphio.py b/tests/comparators/test_morphio.py index 6c426a9..0c57545 100644 --- a/tests/comparators/test_morphio.py +++ b/tests/comparators/test_morphio.py @@ -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. diff --git a/tests/comparators/test_pandas.py b/tests/comparators/test_pandas.py index 281214b..55169a1 100644 --- a/tests/comparators/test_pandas.py +++ b/tests/comparators/test_pandas.py @@ -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. diff --git a/tests/comparators/test_voxcell.py b/tests/comparators/test_voxcell.py index 77094f8..27b0b08 100644 --- a/tests/comparators/test_voxcell.py +++ b/tests/comparators/test_voxcell.py @@ -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. diff --git a/tests/conftest.py b/tests/conftest.py index d5a3c34..cf78f0b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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. @@ -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" ) diff --git a/tests/generate_test_files.py b/tests/generate_test_files.py index a722619..d55a9be 100644 --- a/tests/generate_test_files.py +++ b/tests/generate_test_files.py @@ -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. diff --git a/tests/test_base.py b/tests/test_base.py index c8237cb..a51b116 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -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. @@ -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"], ) diff --git a/tests/test_cli.py b/tests/test_cli.py index 674989a..b2a8388 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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. diff --git a/tests/test_missing_deps.py b/tests/test_missing_deps.py index 267eebc..64740fe 100644 --- a/tests/test_missing_deps.py +++ b/tests/test_missing_deps.py @@ -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. diff --git a/tests/test_pytest_plugin.py b/tests/test_pytest_plugin.py index 83695b5..e9cf91f 100644 --- a/tests/test_pytest_plugin.py +++ b/tests/test_pytest_plugin.py @@ -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. diff --git a/tests/test_util.py b/tests/test_util.py index 3df5671..1417fda 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -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. diff --git a/tests/test_version.py b/tests/test_version.py index e22541f..1e25e1a 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -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.