enforce-rules 3.3.6__tar.gz → 3.3.7__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.3.6/src/enforce_rules.egg-info → enforce_rules-3.3.7}/PKG-INFO +2 -2
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/README.md +1 -1
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/pyproject.toml +1 -1
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules/enforce_rules.py +3 -2
- {enforce_rules-3.3.6 → enforce_rules-3.3.7/src/enforce_rules.egg-info}/PKG-INFO +2 -2
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/LICENSE +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/MANIFEST.in +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/requirements.txt +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/setup.cfg +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules/__init__.py +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules/__init__.pyi +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules/enforce_rules.pyi +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules/py.typed +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules.egg-info/SOURCES.txt +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules.egg-info/dependency_links.txt +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules.egg-info/requires.txt +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/src/enforce_rules.egg-info/top_level.txt +0 -0
- {enforce_rules-3.3.6 → enforce_rules-3.3.7}/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.3.
|
|
3
|
+
Version: 3.3.7
|
|
4
4
|
Summary: Runtime rule validation for Python using dictionary-based constraints.
|
|
5
5
|
Author: Jake Loepker, Microsoft Copilot (AI Assistant), Claude (AI Assistant)
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -71,7 +71,7 @@ MAJOR: 3
|
|
|
71
71
|
|
|
72
72
|
MINOR: 3
|
|
73
73
|
|
|
74
|
-
PATCH:
|
|
74
|
+
PATCH: 7
|
|
75
75
|
|
|
76
76
|
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).
|
|
77
77
|
|
|
@@ -5,6 +5,7 @@ from datetime import datetime
|
|
|
5
5
|
from chess import Piece
|
|
6
6
|
from pydantic import Field, validate_call
|
|
7
7
|
from string import punctuation
|
|
8
|
+
from itertools import pairwise
|
|
8
9
|
|
|
9
10
|
Number: TypeAlias = int | float
|
|
10
11
|
LengthType: TypeAlias = Annotated[int, Field(ge=0)]
|
|
@@ -80,14 +81,14 @@ def _validate_sorted(value: Sequence, expected: bool) -> None:
|
|
|
80
81
|
|
|
81
82
|
def _validate_increasing(value: Sequence, expected: bool) -> None:
|
|
82
83
|
if expected:
|
|
83
|
-
for a, b in
|
|
84
|
+
for a, b in pairwise(value):
|
|
84
85
|
if not (b > a):
|
|
85
86
|
raise ValueError("List must be strictly increasing")
|
|
86
87
|
|
|
87
88
|
|
|
88
89
|
def _validate_decreasing(value: Sequence, expected: bool) -> None:
|
|
89
90
|
if expected:
|
|
90
|
-
for a, b in
|
|
91
|
+
for a, b in pairwise(value):
|
|
91
92
|
if not (b < a):
|
|
92
93
|
raise ValueError("List must be strictly decreasing")
|
|
93
94
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: enforce-rules
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.7
|
|
4
4
|
Summary: Runtime rule validation for Python using dictionary-based constraints.
|
|
5
5
|
Author: Jake Loepker, Microsoft Copilot (AI Assistant), Claude (AI Assistant)
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -71,7 +71,7 @@ MAJOR: 3
|
|
|
71
71
|
|
|
72
72
|
MINOR: 3
|
|
73
73
|
|
|
74
|
-
PATCH:
|
|
74
|
+
PATCH: 7
|
|
75
75
|
|
|
76
76
|
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).
|
|
77
77
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|