dir-content-diff 1.12.0__tar.gz → 1.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/workflows/commitlint.yml +2 -2
  2. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/workflows/publish-sdist.yml +2 -2
  3. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/workflows/run-tox.yml +7 -8
  4. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.gitignore +1 -0
  5. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/CHANGELOG.md +29 -0
  6. {dir_content_diff-1.12.0/dir_content_diff.egg-info → dir_content_diff-1.13.0}/PKG-INFO +35 -5
  7. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/README.md +30 -3
  8. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/__init__.py +268 -78
  9. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/base_comparators.py +9 -16
  10. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/cli/__init__.py +2 -2
  11. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/comparators/__init__.py +1 -1
  12. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/comparators/morphio.py +1 -1
  13. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/comparators/pandas.py +1 -1
  14. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/comparators/voxcell.py +1 -1
  15. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/pytest_plugin.py +1 -1
  16. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/util.py +1 -1
  17. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0/dir_content_diff.egg-info}/PKG-INFO +35 -5
  18. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff.egg-info/SOURCES.txt +1 -0
  19. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff.egg-info/requires.txt +1 -0
  20. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/Makefile +1 -1
  21. dir_content_diff-1.13.0/docs/source/conf.py +209 -0
  22. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/source/index.rst +1 -1
  23. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/pyproject.toml +1 -0
  24. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/setup.py +1 -1
  25. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/__init__.py +1 -1
  26. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/comparators/__init__.py +1 -1
  27. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/comparators/test_morphio.py +1 -1
  28. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/comparators/test_pandas.py +1 -1
  29. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/comparators/test_voxcell.py +1 -1
  30. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/conftest.py +2 -2
  31. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/generate_test_files.py +1 -1
  32. dir_content_diff-1.13.0/tests/test_attrs_validation.py +218 -0
  33. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_base.py +83 -3
  34. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_cli.py +1 -1
  35. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_missing_deps.py +1 -1
  36. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_pytest_plugin.py +1 -1
  37. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_util.py +1 -1
  38. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tests/test_version.py +1 -1
  39. dir_content_diff-1.12.0/docs/source/conf.py +0 -107
  40. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.auto-changelog +0 -0
  41. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.auto-changelog-template.hbs +0 -0
  42. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.codespellignorelines +0 -0
  43. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.codespellrc +0 -0
  44. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.copier-answers.yml +0 -0
  45. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.copyright.tmpl +0 -0
  46. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.coveragerc +0 -0
  47. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.coveragerc_min_versions +0 -0
  48. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.gitattributes +0 -0
  49. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
  50. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  51. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
  52. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/ISSUE_TEMPLATE/how_to_use.yaml +0 -0
  53. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/dependabot.yml +0 -0
  54. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.github/pull_request_template.md +0 -0
  55. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.gitreview +0 -0
  56. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.pre-commit-config.yaml +0 -0
  57. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.pylintrc +0 -0
  58. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/.readthedocs.yml +0 -0
  59. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/AUTHORS.md +0 -0
  60. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/CONTRIBUTING.md +0 -0
  61. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/LICENSE.txt +0 -0
  62. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/MANIFEST.in +0 -0
  63. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/codecov.yml +0 -0
  64. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/commitlint.config.js +0 -0
  65. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff/comparators/dependencies.json +0 -0
  66. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff.egg-info/dependency_links.txt +0 -0
  67. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff.egg-info/entry_points.txt +0 -0
  68. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/dir_content_diff.egg-info/top_level.txt +0 -0
  69. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/source/.gitignore +0 -0
  70. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/source/api_ref.rst +0 -0
  71. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/source/changelog.rst +0 -0
  72. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/docs/source/contributing.rst +0 -0
  73. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/package.json +0 -0
  74. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/setup.cfg +0 -0
  75. {dir_content_diff-1.12.0 → dir_content_diff-1.13.0}/tox.ini +0 -0
@@ -11,8 +11,8 @@ jobs:
11
11
  env:
12
12
  PR_TITLE: ${{ github.event.pull_request.title }}
13
13
  steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
14
+ - uses: actions/checkout@v5
15
+ - uses: actions/setup-node@v5
16
16
  with:
17
17
  node-version: '20'
18
18
  - run: npm install -g --force commitlint @commitlint/cli commitlint-plugin-cleanfeet
@@ -10,9 +10,9 @@ jobs:
10
10
  name: Build and publish on PyPI
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v4
13
+ - uses: actions/checkout@v5
14
14
  - name: Set up Python 3.10
15
- uses: actions/setup-python@v5
15
+ uses: actions/setup-python@v6
16
16
  with:
17
17
  python-version: "3.10"
18
18
  - name: Build a wheel and a source tarball
@@ -6,6 +6,8 @@ on:
6
6
  branches:
7
7
  - main
8
8
  workflow_dispatch:
9
+ schedule:
10
+ - cron: "0 2 15 1,7 *"
9
11
 
10
12
  jobs:
11
13
  build:
@@ -22,20 +24,17 @@ jobs:
22
24
  min_versions: "min_versions"
23
25
 
24
26
  steps:
25
- - uses: actions/checkout@v4
27
+ - uses: actions/checkout@v5
26
28
  - name: Set up Python ${{ matrix.python-version }}
27
- uses: actions/setup-python@v5
29
+ uses: actions/setup-python@v6
28
30
  with:
29
31
  python-version: ${{ matrix.python-version }}
30
32
  - name: Get current month
31
33
  id: date
32
34
  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
35
+ - name: Install APT Packages
36
+ run: |
37
+ sudo apt-get install -y poppler-utils imagemagick
39
38
  - name: Cache tox and precommit environments
40
39
  uses: actions/cache@v4
41
40
  with:
@@ -30,6 +30,7 @@ test_venv
30
30
  docs/build
31
31
  docs/source/generated
32
32
  docs/source/examples
33
+ docs/source/README_processed.md
33
34
 
34
35
  # reports
35
36
  reports
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.13.0](https://github.com/BlueBrain/dir-content-diff/compare/1.12.1..1.13.0)
4
+
5
+ > 12 September 2025
6
+
7
+ ### New Features
8
+
9
+ - Add patterns to ignore files in the reference directory (Adrien Berchet - [#86](https://github.com/BlueBrain/dir-content-diff/pull/86))
10
+
11
+ ### Documentation Changes
12
+
13
+ - Fix format in Sphinx (Adrien Berchet - [#85](https://github.com/BlueBrain/dir-content-diff/pull/85))
14
+ - Clarify how reference and compared directories are processed (Adrien Berchet - [#83](https://github.com/BlueBrain/dir-content-diff/pull/83))
15
+
16
+ ### Performance Improvements
17
+
18
+ - Build comparator registry only once before iterating over all files (Adrien Berchet - [#87](https://github.com/BlueBrain/dir-content-diff/pull/87))
19
+
20
+ ## [1.12.1](https://github.com/BlueBrain/dir-content-diff/compare/1.12.0..1.12.1)
21
+
22
+ > 3 July 2025
23
+
24
+ ### Fixes
25
+
26
+ - Properly update the verbosity in PDF comparator (Adrien Berchet - [#75](https://github.com/BlueBrain/dir-content-diff/pull/75))
27
+
28
+ ### CI Improvements
29
+
30
+ - Schedule CI every 6 months (Adrien Berchet - [#76](https://github.com/BlueBrain/dir-content-diff/pull/76))
31
+
3
32
  ## [1.12.0](https://github.com/BlueBrain/dir-content-diff/compare/1.11.0..1.12.0)
4
33
 
5
34
  > 18 November 2024
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: dir-content-diff
3
- Version: 1.12.0
3
+ Version: 1.13.0
4
4
  Summary: Simple tool to compare directory contents.
5
5
  Author: Blue Brain Project, EPFL
6
6
  License: Apache License 2.0
@@ -21,6 +21,7 @@ Requires-Python: >=3.9
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE.txt
23
23
  License-File: AUTHORS.md
24
+ Requires-Dist: attrs>=21.3.0
24
25
  Requires-Dist: click>=8
25
26
  Requires-Dist: dictdiffer>=0.8
26
27
  Requires-Dist: dicttoxml>=1.7.12
@@ -60,6 +61,8 @@ Requires-Dist: morph_tool>=2.9; extra == "morphio"
60
61
  Provides-Extra: voxcell
61
62
  Requires-Dist: voxcell>=3.1.1; extra == "voxcell"
62
63
  Requires-Dist: pynrrd<1.1,>=0.4; extra == "voxcell"
64
+ Dynamic: license-file
65
+ Dynamic: provides-extra
63
66
 
64
67
  [![Version](https://img.shields.io/pypi/v/dir-content-diff)](https://github.com/BlueBrain/dir-content-diff/releases)
65
68
  [![Build status](https://github.com/BlueBrain/dir-content-diff/actions/workflows/run-tox.yml/badge.svg?branch=main)](https://github.com/BlueBrain/dir-content-diff/actions)
@@ -99,7 +102,7 @@ the files, so it is not able to report which values are different.
99
102
 
100
103
  ### Compare two directories
101
104
 
102
- If one wants to compare two directories with the following structures:
105
+ Let's compare two directories with the following structures:
103
106
 
104
107
  ```bash
105
108
  └── reference_dir
@@ -118,6 +121,9 @@ If one wants to compare two directories with the following structures:
118
121
  └── file_1.c
119
122
  ```
120
123
 
124
+ The `reference` directory contains all the files that should be checked in the `compared` directory,
125
+ which means that extraneous files in the `compared` directory are just ignored.
126
+
121
127
  These two directories can be compared with the following code:
122
128
 
123
129
  ```python
@@ -126,7 +132,15 @@ import dir_content_diff
126
132
  dir_content_diff.compare_trees("reference_dir", "compared_dir")
127
133
  ```
128
134
 
129
- This code will return an empty dictionary because no difference was detected.
135
+ > [!WARNING]
136
+ > The order of the parameters is important: the first path is considered as the `reference`
137
+ > directory while the second one is the `compared` directory. Inverting the parameters may return
138
+ > a different result (in this example it would return that the file `sub_file_3.b` is missing).
139
+
140
+ If all the files are identical, this code will return an empty dictionary because no difference
141
+ was detected. As mentioned previously, this is because `dir-content-diff` is only looking for files
142
+ in the compared directory that are also present in the reference directory, so the file
143
+ `sub_file_3.b` is just ignored in this case.
130
144
 
131
145
  If ``reference_dir/file_1.c`` is the following JSON-like file:
132
146
 
@@ -226,7 +240,7 @@ specific_args = {
226
240
  }
227
241
  ```
228
242
 
229
- And last but not least, it's possible to use regular expressions to associate specific arguments to
243
+ Another possibility is to use regular expressions to associate specific arguments to
230
244
  a set of files:
231
245
 
232
246
  ```python
@@ -238,6 +252,22 @@ specific_args = {
238
252
  }
239
253
  ```
240
254
 
255
+ And last but not least, it's possible to filter files from the reference directory (for example
256
+ because the reference directory contains temporary files that should not be compared). For
257
+ example, the following code will ignore all files whose name does not start with `file_` and does
258
+ not ends with `_tmp.yaml`:
259
+
260
+ ```python
261
+ import dir_content_diff
262
+
263
+ dir_content_diff.compare_trees(
264
+ "reference_dir",
265
+ "compared_dir",
266
+ include_patterns=[r"file_.*"],
267
+ exclude_patterns=[r".*_tmp\.yaml"],
268
+ )
269
+ ```
270
+
241
271
 
242
272
  ### Export formatted data
243
273
 
@@ -36,7 +36,7 @@ the files, so it is not able to report which values are different.
36
36
 
37
37
  ### Compare two directories
38
38
 
39
- If one wants to compare two directories with the following structures:
39
+ Let's compare two directories with the following structures:
40
40
 
41
41
  ```bash
42
42
  └── reference_dir
@@ -55,6 +55,9 @@ If one wants to compare two directories with the following structures:
55
55
  └── file_1.c
56
56
  ```
57
57
 
58
+ The `reference` directory contains all the files that should be checked in the `compared` directory,
59
+ which means that extraneous files in the `compared` directory are just ignored.
60
+
58
61
  These two directories can be compared with the following code:
59
62
 
60
63
  ```python
@@ -63,7 +66,15 @@ import dir_content_diff
63
66
  dir_content_diff.compare_trees("reference_dir", "compared_dir")
64
67
  ```
65
68
 
66
- This code will return an empty dictionary because no difference was detected.
69
+ > [!WARNING]
70
+ > The order of the parameters is important: the first path is considered as the `reference`
71
+ > directory while the second one is the `compared` directory. Inverting the parameters may return
72
+ > a different result (in this example it would return that the file `sub_file_3.b` is missing).
73
+
74
+ If all the files are identical, this code will return an empty dictionary because no difference
75
+ was detected. As mentioned previously, this is because `dir-content-diff` is only looking for files
76
+ in the compared directory that are also present in the reference directory, so the file
77
+ `sub_file_3.b` is just ignored in this case.
67
78
 
68
79
  If ``reference_dir/file_1.c`` is the following JSON-like file:
69
80
 
@@ -163,7 +174,7 @@ specific_args = {
163
174
  }
164
175
  ```
165
176
 
166
- And last but not least, it's possible to use regular expressions to associate specific arguments to
177
+ Another possibility is to use regular expressions to associate specific arguments to
167
178
  a set of files:
168
179
 
169
180
  ```python
@@ -175,6 +186,22 @@ specific_args = {
175
186
  }
176
187
  ```
177
188
 
189
+ And last but not least, it's possible to filter files from the reference directory (for example
190
+ because the reference directory contains temporary files that should not be compared). For
191
+ example, the following code will ignore all files whose name does not start with `file_` and does
192
+ not ends with `_tmp.yaml`:
193
+
194
+ ```python
195
+ import dir_content_diff
196
+
197
+ dir_content_diff.compare_trees(
198
+ "reference_dir",
199
+ "compared_dir",
200
+ include_patterns=[r"file_.*"],
201
+ exclude_patterns=[r".*_tmp\.yaml"],
202
+ )
203
+ ```
204
+
178
205
 
179
206
  ### Export formatted data
180
207