approval-utilities 14.0.0__py3-none-any.whl → 14.1.0__py3-none-any.whl

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.

Potentially problematic release.


This version of approval-utilities might be problematic. Click here for more details.

@@ -1,8 +1,11 @@
1
1
  import inspect
2
2
  import json
3
3
  import os
4
+
4
5
  from copy import deepcopy
5
6
 
7
+ from typing import Callable, Dict, TypeVar
8
+
6
9
 
7
10
  def get_adjacent_file(name: str) -> str:
8
11
  calling_file = inspect.stack(1)[1][1]
@@ -53,12 +56,17 @@ def is_windows_os() -> bool:
53
56
 
54
57
 
55
58
  def create_empty_file(file_path: str) -> None:
56
- import empty_files.empty_files
59
+ try:
60
+ import empty_files.empty_files
57
61
 
58
- empty_files.empty_files.create_empty_file(file_path)
62
+ empty_files.empty_files.create_empty_file(file_path)
63
+ except ImportError as e:
64
+ print("Error importing empty_files", e)
65
+ raise
59
66
 
60
67
 
61
68
  def ensure_file_exists(approved_path: str) -> None:
69
+ print("approved_path check", approved_path)
62
70
  if not os.path.isfile(approved_path):
63
71
  create_empty_file(approved_path)
64
72
 
@@ -76,3 +84,11 @@ def print_grid(width, height, cell_print_func):
76
84
  result += cell_print_func(x, y)
77
85
  result += "\n"
78
86
  return result
87
+
88
+
89
+ _V = TypeVar("_V")
90
+ _K = TypeVar("_K")
91
+
92
+
93
+ def filter_values(filter: Callable[[_V], bool], a_dict: Dict[_K, _V]) -> Dict[_K, _V]:
94
+ return {k: v for k, v in a_dict.items() if filter(v)}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: approval_utilities
3
- Version: 14.0.0
3
+ Version: 14.1.0
4
4
  Summary: Utilities for your production code that work well with approvaltests
5
5
  Home-page: https://github.com/approvals/ApprovalTests.Python
6
6
  Author: ApprovalTests Contributors
@@ -1,6 +1,6 @@
1
1
  approval_utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  approval_utilities/list_utils.py,sha256=7OT3YkysNmq3ZD7shzirQ8S9Yqf2rS7ckcMNKbC1Jf0,551
3
- approval_utilities/utils.py,sha256=1M9HHAGfzFEajZPJj1-hXQaolTU4v42UjfylZd_xxSs,2127
3
+ approval_utilities/utils.py,sha256=PLtz9Lv8kHeiyI3urKo7FTiiynXq_TnAX18agWuT--I,2515
4
4
  approval_utilities/approvaltests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  approval_utilities/approvaltests/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  approval_utilities/approvaltests/core/executable_command.py,sha256=LFLD36fAe1ek8YlKdZbj8j3dfJ8InFBnIGS8OzaDxDQ,428
@@ -27,8 +27,8 @@ approval_utilities/utilities/logger/simple_logger.py,sha256=-MQ1sii7u5VYFO_Zle51
27
27
  approval_utilities/utilities/persistence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  approval_utilities/utilities/persistence/loader.py,sha256=0kLYZRhJh_SX4j6Fxf_9jN64WcgcgMoFTKkUd10S9vM,218
29
29
  approval_utilities/utilities/persistence/saver.py,sha256=_xZxyeNkzAweicun69mgBYSakyeObJxesy7aVAIdWl0,223
30
- approval_utilities-14.0.0.dist-info/LICENSE,sha256=c7p036pSC0mkAbXSFFmoUjoUbzt1GKgz7qXvqFEwv2g,10273
31
- approval_utilities-14.0.0.dist-info/METADATA,sha256=1REeFzKSnRiCuG61bQL5LVN9WStn5A7Pip143bLLA44,1005
32
- approval_utilities-14.0.0.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
33
- approval_utilities-14.0.0.dist-info/top_level.txt,sha256=9uDtIZHmdLyDNIBh-jNfEM1dA6lBDmo5ftR376zOiv4,19
34
- approval_utilities-14.0.0.dist-info/RECORD,,
30
+ approval_utilities-14.1.0.dist-info/LICENSE,sha256=c7p036pSC0mkAbXSFFmoUjoUbzt1GKgz7qXvqFEwv2g,10273
31
+ approval_utilities-14.1.0.dist-info/METADATA,sha256=kydD39WMyRBbUqOvd_Fbxidel3WIEQmXarYaGg_mlus,1005
32
+ approval_utilities-14.1.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
33
+ approval_utilities-14.1.0.dist-info/top_level.txt,sha256=9uDtIZHmdLyDNIBh-jNfEM1dA6lBDmo5ftR376zOiv4,19
34
+ approval_utilities-14.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5