dir-content-diff 1.9.1__tar.gz → 1.10.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.
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.pre-commit-config.yaml +1 -1
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/CHANGELOG.md +8 -0
- {dir_content_diff-1.9.1/dir_content_diff.egg-info → dir_content_diff-1.10.0}/PKG-INFO +1 -1
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/base_comparators.py +12 -12
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0/dir_content_diff.egg-info}/PKG-INFO +1 -1
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/test_base.py +36 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.auto-changelog +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.auto-changelog-template.hbs +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.codespellignorelines +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.codespellrc +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.copier-answers.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.coveragerc +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.coveragerc_min_versions +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.flake8 +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.gitattributes +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/ISSUE_TEMPLATE/how_to_use.yaml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/dependabot.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/pull_request_template.md +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/workflows/commitlint.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/workflows/publish-sdist.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/workflows/run-tox.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.gitignore +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.gitreview +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.pylintrc +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.readthedocs.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/AUTHORS.md +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/CONTRIBUTING.md +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/LICENSE.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/MANIFEST.in +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/README.md +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/codecov.yml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/commitlint.config.js +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/__init__.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/__init__.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/dependencies.json +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/morphio.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/pandas.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/voxcell.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/pytest_plugin.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/util.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/SOURCES.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/dependency_links.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/entry_points.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/requires.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/top_level.txt +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/Makefile +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/.gitignore +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/api_ref.rst +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/changelog.rst +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/conf.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/contributing.rst +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/docs/source/index.rst +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/package.json +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/pyproject.toml +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/setup.cfg +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/setup.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/__init__.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/comparators/__init__.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/comparators/test_morphio.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/comparators/test_pandas.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/comparators/test_voxcell.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/conftest.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/generate_test_files.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/test_missing_deps.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/test_pytest_plugin.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/test_util.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tests/test_version.py +0 -0
- {dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/tox.ini +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.10.0](https://github.com/BlueBrain/dir-content-diff/compare/1.9.1..1.10.0)
|
|
4
|
+
|
|
5
|
+
> 9 September 2024
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- Add parameters for load and save methods of base comparators (Adrien Berchet - [#64](https://github.com/BlueBrain/dir-content-diff/pull/64))
|
|
10
|
+
|
|
3
11
|
## [1.9.1](https://github.com/BlueBrain/dir-content-diff/compare/1.9.0..1.9.1)
|
|
4
12
|
|
|
5
13
|
> 29 August 2024
|
|
@@ -406,16 +406,16 @@ class JsonComparator(DictComparator):
|
|
|
406
406
|
This comparator is based on the :class:`DictComparator` and uses the same parameters.
|
|
407
407
|
"""
|
|
408
408
|
|
|
409
|
-
def load(self, path):
|
|
409
|
+
def load(self, path, **kwargs):
|
|
410
410
|
"""Open a JSON file."""
|
|
411
411
|
with open(path) as file: # pylint: disable=unspecified-encoding
|
|
412
|
-
data = json.load(file)
|
|
412
|
+
data = json.load(file, **kwargs)
|
|
413
413
|
return data
|
|
414
414
|
|
|
415
|
-
def save(self, data, path):
|
|
415
|
+
def save(self, data, path, **kwargs):
|
|
416
416
|
"""Save formatted data into a JSON file."""
|
|
417
417
|
with open(path, "w", encoding="utf-8") as file:
|
|
418
|
-
json.dump(data, file)
|
|
418
|
+
json.dump(data, file, **kwargs)
|
|
419
419
|
|
|
420
420
|
|
|
421
421
|
class YamlComparator(DictComparator):
|
|
@@ -424,16 +424,16 @@ class YamlComparator(DictComparator):
|
|
|
424
424
|
This comparator is based on the :class:`DictComparator` and uses the same parameters.
|
|
425
425
|
"""
|
|
426
426
|
|
|
427
|
-
def load(self, path):
|
|
427
|
+
def load(self, path, **kwargs):
|
|
428
428
|
"""Open a YAML file."""
|
|
429
429
|
with open(path) as file: # pylint: disable=unspecified-encoding
|
|
430
|
-
data = yaml.full_load(file)
|
|
430
|
+
data = yaml.full_load(file, **kwargs)
|
|
431
431
|
return data
|
|
432
432
|
|
|
433
|
-
def save(self, data, path):
|
|
433
|
+
def save(self, data, path, **kwargs):
|
|
434
434
|
"""Save formatted data into a YAML file."""
|
|
435
435
|
with open(path, "w", encoding="utf-8") as file:
|
|
436
|
-
yaml.dump(data, file)
|
|
436
|
+
yaml.dump(data, file, **kwargs)
|
|
437
437
|
|
|
438
438
|
|
|
439
439
|
class XmlComparator(DictComparator):
|
|
@@ -468,10 +468,10 @@ class XmlComparator(DictComparator):
|
|
|
468
468
|
data = self.xmltodict(file.read())
|
|
469
469
|
return data
|
|
470
470
|
|
|
471
|
-
def save(self, data, path):
|
|
471
|
+
def save(self, data, path, root=False, **kwargs):
|
|
472
472
|
"""Save formatted data into a XML file."""
|
|
473
473
|
with open(path, "w", encoding="utf-8") as file:
|
|
474
|
-
file.write(dicttoxml(data
|
|
474
|
+
file.write(dicttoxml(data, root=root, **kwargs).decode())
|
|
475
475
|
|
|
476
476
|
@staticmethod
|
|
477
477
|
def _cast_from_attribute(text, attr):
|
|
@@ -544,10 +544,10 @@ class IniComparator(DictComparator):
|
|
|
544
544
|
data.read(path)
|
|
545
545
|
return self.configparser_to_dict(data)
|
|
546
546
|
|
|
547
|
-
def save(self, data, path):
|
|
547
|
+
def save(self, data, path, **kwargs):
|
|
548
548
|
"""Save formatted data into a INI file."""
|
|
549
549
|
with open(path, "w", encoding="utf-8") as file:
|
|
550
|
-
self.dict_to_configparser(data).write(file)
|
|
550
|
+
self.dict_to_configparser(data, **kwargs).write(file)
|
|
551
551
|
|
|
552
552
|
@staticmethod
|
|
553
553
|
def configparser_to_dict(config):
|
|
@@ -410,9 +410,35 @@ class TestBaseComparator:
|
|
|
410
410
|
assert kwargs_msg in no_report_diff_default
|
|
411
411
|
assert no_report_diff_default.replace(kwargs_msg, "") == diff
|
|
412
412
|
|
|
413
|
+
@staticmethod
|
|
414
|
+
def common_test_load_save(tmp_path, comparator):
|
|
415
|
+
"""Test load and save capabilities of the given comparator."""
|
|
416
|
+
initial_data = {
|
|
417
|
+
"a": {
|
|
418
|
+
"b": 1,
|
|
419
|
+
"c": [1, 2, 3],
|
|
420
|
+
"d": {
|
|
421
|
+
"test_str": "a str",
|
|
422
|
+
"test_int": 999,
|
|
423
|
+
},
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
initial_file = tmp_path / "initial_file.json"
|
|
428
|
+
comparator.save(initial_data, initial_file)
|
|
429
|
+
|
|
430
|
+
loaded_data = comparator.load(initial_file)
|
|
431
|
+
|
|
432
|
+
assert loaded_data == initial_data
|
|
433
|
+
|
|
413
434
|
class TestJsonComparator:
|
|
414
435
|
"""Test the JSON comparator."""
|
|
415
436
|
|
|
437
|
+
def test_load_save(self, tmp_path):
|
|
438
|
+
"""Test load and save capabilities of the comparator."""
|
|
439
|
+
comparator = dir_content_diff.JsonComparator()
|
|
440
|
+
TestBaseComparator.common_test_load_save(tmp_path, comparator)
|
|
441
|
+
|
|
416
442
|
def test_format_data(self):
|
|
417
443
|
"""Test data formatting."""
|
|
418
444
|
data = {
|
|
@@ -490,6 +516,11 @@ class TestBaseComparator:
|
|
|
490
516
|
class TestXmlComparator:
|
|
491
517
|
"""Test the XML comparator."""
|
|
492
518
|
|
|
519
|
+
def test_load_save(self, tmp_path):
|
|
520
|
+
"""Test load and save capabilities of the comparator."""
|
|
521
|
+
comparator = dir_content_diff.XmlComparator()
|
|
522
|
+
TestBaseComparator.common_test_load_save(tmp_path, comparator)
|
|
523
|
+
|
|
493
524
|
def test_xmltodict(self):
|
|
494
525
|
"""Test all types of the xmltodict auto cast feature."""
|
|
495
526
|
comparator = dir_content_diff.XmlComparator()
|
|
@@ -574,6 +605,11 @@ class TestBaseComparator:
|
|
|
574
605
|
class TestIniComparator:
|
|
575
606
|
"""Test the INI comparator."""
|
|
576
607
|
|
|
608
|
+
def test_load_save(self, tmp_path):
|
|
609
|
+
"""Test load and save capabilities of the comparator."""
|
|
610
|
+
comparator = dir_content_diff.IniComparator()
|
|
611
|
+
TestBaseComparator.common_test_load_save(tmp_path, comparator)
|
|
612
|
+
|
|
577
613
|
def test_initodict(self, ref_tree):
|
|
578
614
|
"""Test conversion of INI files into dict."""
|
|
579
615
|
data = configparser.ConfigParser()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/.github/ISSUE_TEMPLATE/feature_request.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff/comparators/dependencies.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{dir_content_diff-1.9.1 → dir_content_diff-1.10.0}/dir_content_diff.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|