py-api-dumper 4.2.0__tar.gz → 4.2.1__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 (23) hide show
  1. {py_api_dumper-4.2.0/src/py_api_dumper.egg-info → py_api_dumper-4.2.1}/PKG-INFO +1 -1
  2. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper/__init__.py +12 -9
  3. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1/src/py_api_dumper.egg-info}/PKG-INFO +1 -1
  4. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/LICENSES/CC0-1.0.txt +0 -0
  5. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/LICENSES/MIT.txt +0 -0
  6. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/MANIFEST.in +0 -0
  7. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/README.md +0 -0
  8. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/pyproject.toml +0 -0
  9. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/setup.cfg +0 -0
  10. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper/cli.py +0 -0
  11. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper.egg-info/SOURCES.txt +0 -0
  12. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper.egg-info/dependency_links.txt +0 -0
  13. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper.egg-info/entry_points.txt +0 -0
  14. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/src/py_api_dumper.egg-info/top_level.txt +0 -0
  15. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/api_ref/__init__.py +0 -0
  16. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/api_ref/_priv_mod.py +0 -0
  17. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/api_ref/api_ref.txt +0 -0
  18. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/api_ref/ext_mod.c +0 -0
  19. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/api_ref/pub_mod.py +0 -0
  20. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/conftest.py +0 -0
  21. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/setup.py +0 -0
  22. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/test_diff.py +0 -0
  23. {py_api_dumper-4.2.0 → py_api_dumper-4.2.1}/test/test_dump.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-api-dumper
3
- Version: 4.2.0
3
+ Version: 4.2.1
4
4
  Summary: Python API dumping and comparison tool
5
5
  Author-email: Karl Wette <karl.wette@anu.edu.au>
6
6
  License-Expression: MIT
@@ -30,7 +30,7 @@ from typing import (
30
30
  )
31
31
 
32
32
  __author__ = "Karl Wette"
33
- __version__ = "4.2.0"
33
+ __version__ = "4.2.1"
34
34
 
35
35
  APIFilterType = TypeVar("APIFilterType", bound="APIFilter")
36
36
  APIDumpType = TypeVar("APIDumpType", bound="APIDump")
@@ -535,6 +535,7 @@ class APIDiff:
535
535
  self,
536
536
  old: APIDump,
537
537
  new: APIDump,
538
+ ignore_filters: Optional[List[APIFilter]] = None,
538
539
  ):
539
540
  """Differences between two Python public API dumps.
540
541
 
@@ -543,6 +544,8 @@ class APIDiff:
543
544
  Dump of the old public API.
544
545
  new (APIDump):
545
546
  Dump of the new public API.
547
+ ignore_filters (Optional[List[APIFilter]]):
548
+ Remove API entries that match filters.
546
549
  """
547
550
 
548
551
  self.old_dump_file = old.dump_file
@@ -551,6 +554,11 @@ class APIDiff:
551
554
  self.new_dump_file = new.dump_file
552
555
  self.new_modules = new.modules
553
556
 
557
+ # Apply filters
558
+ if ignore_filters and len(ignore_filters) > 0:
559
+ old = old.apply_ignore_filter(ignore_filters)
560
+ new = new.apply_ignore_filter(ignore_filters)
561
+
554
562
  # Entries removed from `new` that remain in `old`
555
563
  self.removed = frozenset(old.api - new.api)
556
564
 
@@ -562,7 +570,7 @@ class APIDiff:
562
570
  cls: Type[APIDiffType],
563
571
  old_dump_file: Union[Path, str],
564
572
  new_dump_file: Union[Path, str],
565
- ignore_filters: Optional[List[APIFilterType]] = None,
573
+ ignore_filters: Optional[List[APIFilter]] = None,
566
574
  ) -> APIDiffType:
567
575
  """Differences between two Python public API dumps loaded from files.
568
576
 
@@ -571,7 +579,7 @@ class APIDiff:
571
579
  Name of file containing dump of the old public API.
572
580
  new_dump_file (Union[Path, str]):
573
581
  Name of file containing dump of the new public API.
574
- ignore_filters (Optional[List[APIFilterType]]):
582
+ ignore_filters (Optional[List[APIFilter]]):
575
583
  Remove API entries that match filters.
576
584
 
577
585
  Returns:
@@ -582,13 +590,8 @@ class APIDiff:
582
590
  old = APIDump.load_from_file(old_dump_file)
583
591
  new = APIDump.load_from_file(new_dump_file)
584
592
 
585
- # Apply filters
586
- if ignore_filters and len(ignore_filters) > 0:
587
- old = old.apply_ignore_filter(ignore_filters)
588
- new = new.apply_ignore_filter(ignore_filters)
589
-
590
593
  # Create instance
591
- inst = cls(old, new)
594
+ inst = cls(old, new, ignore_filters)
592
595
 
593
596
  return inst
594
597
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-api-dumper
3
- Version: 4.2.0
3
+ Version: 4.2.1
4
4
  Summary: Python API dumping and comparison tool
5
5
  Author-email: Karl Wette <karl.wette@anu.edu.au>
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes