enforce-rules 3.2.9__tar.gz → 3.2.11__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: 3.2.9
3
+ Version: 3.2.11
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: 3
63
63
 
64
64
  MINOR: 2
65
65
 
66
- PATCH: 9
66
+ PATCH: 11
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: 3
7
7
 
8
8
  MINOR: 2
9
9
 
10
- PATCH: 9
10
+ PATCH: 11
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 = "3.2.9"
3
+ version = "3.2.11"
4
4
  description = "Runtime rule validation for Python using dictionary-based constraints."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -3,7 +3,7 @@ from collections.abc import Iterable, Sequence, Container
3
3
  import re
4
4
  from datetime import datetime
5
5
  from chess import Piece
6
- from pydantic import PositiveInt
6
+ from pydantic import PositiveInt, validate_call
7
7
 
8
8
  Number: TypeAlias = int | float
9
9
  LengthType: TypeAlias = PositiveInt | Literal[0]
@@ -11,16 +11,17 @@ LengthType: TypeAlias = PositiveInt | Literal[0]
11
11
  # VALIDATOR FUNCTIONS (DEFINED FIRST)
12
12
  # -----------------------------
13
13
 
14
+ @validate_call
14
15
  def _validate_length(value: Sequence, expected: LengthType) -> None:
15
16
  if len(value) != expected:
16
17
  raise ValueError(f"Expected length {expected}, got {len(value)}")
17
18
 
18
-
19
+ @validate_call
19
20
  def _validate_min_length(value: Sequence, expected: LengthType) -> None:
20
21
  if len(value) < expected:
21
22
  raise ValueError(f"Expected min length {expected}, got {len(value)}")
22
23
 
23
-
24
+ @validate_call
24
25
  def _validate_max_length(value: Sequence, expected: LengthType) -> None:
25
26
  if len(value) > expected:
26
27
  raise ValueError(f"Expected max length {expected}, got {len(value)}")
@@ -158,7 +159,7 @@ def _validate_is_password(value: str, rule: bool) -> None:
158
159
  symbols: Container[str] = {
159
160
  "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
160
161
  ":", ";", "<", "=", ">", "?", "@",
161
- "[", r"\", "]", "^", "_", "`",
162
+ "[", "\\", "]", "^", "_", "`",
162
163
  "{", "|", "}", "~",
163
164
  }
164
165
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enforce-rules
3
- Version: 3.2.9
3
+ Version: 3.2.11
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: 3
63
63
 
64
64
  MINOR: 2
65
65
 
66
- PATCH: 9
66
+ PATCH: 11
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