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.
- {enforce_rules-3.2.9/src/enforce_rules.egg-info → enforce_rules-3.2.11}/PKG-INFO +2 -2
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/README.md +1 -1
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/pyproject.toml +1 -1
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules/enforce_rules.py +5 -4
- {enforce_rules-3.2.9 → enforce_rules-3.2.11/src/enforce_rules.egg-info}/PKG-INFO +2 -2
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/LICENSE +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/setup.cfg +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules/__init__.py +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules.egg-info/SOURCES.txt +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules.egg-info/dependency_links.txt +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules.egg-info/top_level.txt +0 -0
- {enforce_rules-3.2.9 → enforce_rules-3.2.11}/tests/test_enforce_rules.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: enforce-rules
|
|
3
|
-
Version: 3.2.
|
|
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:
|
|
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
|
|
|
@@ -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
|
-
"[",
|
|
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.
|
|
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:
|
|
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
|
|
File without changes
|
|
File without changes
|
{enforce_rules-3.2.9 → enforce_rules-3.2.11}/src/enforce_rules.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|