enforce-rules 2.0.2__tar.gz → 2.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enforce-rules
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Runtime rule validation for Python using dictionary-based constraints.
5
5
  Author: Jake Loepker, Microsoft Copilot (AI Assistant)
6
6
  License: BSD 3-Clause License
@@ -63,7 +63,7 @@ MAJOR: 2
63
63
 
64
64
  MINOR: 0
65
65
 
66
- PATCH: 2
66
+ PATCH: 4
67
67
 
68
68
  If you need to catch up, you can see the full version history in the [CHANGELOG](https://github.com/Loepker-James/enforce-rules/blob/main/CHANGELOG.md).
69
69
 
@@ -7,7 +7,7 @@ MAJOR: 2
7
7
 
8
8
  MINOR: 0
9
9
 
10
- PATCH: 2
10
+ PATCH: 4
11
11
 
12
12
  If you need to catch up, you can see the full version history in the [CHANGELOG](https://github.com/Loepker-James/enforce-rules/blob/main/CHANGELOG.md).
13
13
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "enforce-rules"
3
- version = "2.0.2"
3
+ version = "2.0.4"
4
4
  description = "Runtime rule validation for Python using dictionary-based constraints."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,8 +1,9 @@
1
- from typing import Dict, Iterable, Callable, Sequence
1
+ from typing import Dict, Iterable, Callable, Sequence, Literal, TypeVar
2
2
  import re
3
3
  from datetime import datetime
4
4
 
5
5
 
6
+
6
7
  # -----------------------------
7
8
  # VALIDATOR FUNCTIONS (DEFINED FIRST)
8
9
  # -----------------------------
@@ -126,8 +127,8 @@ def _validate_after_date(value: object, reference: object) -> None:
126
127
  # -----------------------------
127
128
  # VALIDATE() — DEFINED LAST
128
129
  # -----------------------------
129
-
130
- def validate(value: Any, rules: Dict[str, Any]) -> Any:
130
+ T = TypeVar("T")
131
+ def validate(value: T, rules: Dict[str, object]) -> T:
131
132
  """
132
133
  Validate a value against a dictionary of rules.
133
134
  Returns the original value if valid, otherwise raises ValueError.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enforce-rules
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Runtime rule validation for Python using dictionary-based constraints.
5
5
  Author: Jake Loepker, Microsoft Copilot (AI Assistant)
6
6
  License: BSD 3-Clause License
@@ -63,7 +63,7 @@ MAJOR: 2
63
63
 
64
64
  MINOR: 0
65
65
 
66
- PATCH: 2
66
+ PATCH: 4
67
67
 
68
68
  If you need to catch up, you can see the full version history in the [CHANGELOG](https://github.com/Loepker-James/enforce-rules/blob/main/CHANGELOG.md).
69
69
 
File without changes
File without changes