enforce-rules 2.0.0__tar.gz → 2.0.2__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-2.0.0/src/enforce_rules.egg-info → enforce_rules-2.0.2}/PKG-INFO +17 -3
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/README.md +16 -2
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/pyproject.toml +1 -1
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/src/enforce_rules/enforce_rules.py +1 -1
- {enforce_rules-2.0.0 → enforce_rules-2.0.2/src/enforce_rules.egg-info}/PKG-INFO +17 -3
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/LICENSE +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/setup.cfg +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/src/enforce_rules/__init__.py +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/src/enforce_rules.egg-info/SOURCES.txt +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/src/enforce_rules.egg-info/dependency_links.txt +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/src/enforce_rules.egg-info/top_level.txt +0 -0
- {enforce_rules-2.0.0 → enforce_rules-2.0.2}/tests/test_enforce_rules.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: enforce-rules
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
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:
|
|
66
|
+
PATCH: 2
|
|
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
|
|
|
@@ -260,7 +260,21 @@ Turns out I didn't notice this in my code, until 1.1.0. This is the regex flags
|
|
|
260
260
|
|
|
261
261
|
```python
|
|
262
262
|
from re import RegexFlag
|
|
263
|
-
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M |
|
|
263
|
+
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M | RegexFlag.X
|
|
264
|
+
```
|
|
265
|
+
before_date
|
|
266
|
+
|
|
267
|
+
Value must be strictly before the given datetime.
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
validate(datetime(1999, 8, 29), {"before_date": datetime(2000, 1, 1)})
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
after_date
|
|
274
|
+
|
|
275
|
+
Value must be strictly after the given datetime.
|
|
276
|
+
```python
|
|
277
|
+
validate(datetime(2026, 8, 29), {"after_date": datetime(2000, 1, 1)})
|
|
264
278
|
```
|
|
265
279
|
|
|
266
280
|
must_be_true
|
|
@@ -7,7 +7,7 @@ MAJOR: 2
|
|
|
7
7
|
|
|
8
8
|
MINOR: 0
|
|
9
9
|
|
|
10
|
-
PATCH:
|
|
10
|
+
PATCH: 2
|
|
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
|
|
|
@@ -204,7 +204,21 @@ Turns out I didn't notice this in my code, until 1.1.0. This is the regex flags
|
|
|
204
204
|
|
|
205
205
|
```python
|
|
206
206
|
from re import RegexFlag
|
|
207
|
-
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M |
|
|
207
|
+
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M | RegexFlag.X
|
|
208
|
+
```
|
|
209
|
+
before_date
|
|
210
|
+
|
|
211
|
+
Value must be strictly before the given datetime.
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
validate(datetime(1999, 8, 29), {"before_date": datetime(2000, 1, 1)})
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
after_date
|
|
218
|
+
|
|
219
|
+
Value must be strictly after the given datetime.
|
|
220
|
+
```python
|
|
221
|
+
validate(datetime(2026, 8, 29), {"after_date": datetime(2000, 1, 1)})
|
|
208
222
|
```
|
|
209
223
|
|
|
210
224
|
must_be_true
|
|
@@ -178,7 +178,7 @@ def validate(value: Any, rules: Dict[str, Any]) -> Any:
|
|
|
178
178
|
_validate_before_date(value, rule)
|
|
179
179
|
case "after_date":
|
|
180
180
|
_validate_after_date(value, rule)
|
|
181
|
-
case
|
|
181
|
+
case x if x != "regex_flags":
|
|
182
182
|
raise ValueError(f"Unknown rule: {key}")
|
|
183
183
|
|
|
184
184
|
return value
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: enforce-rules
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
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:
|
|
66
|
+
PATCH: 2
|
|
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
|
|
|
@@ -260,7 +260,21 @@ Turns out I didn't notice this in my code, until 1.1.0. This is the regex flags
|
|
|
260
260
|
|
|
261
261
|
```python
|
|
262
262
|
from re import RegexFlag
|
|
263
|
-
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M |
|
|
263
|
+
cat_or_dog = validate("cat", {"regex": "cat|dog", {"regex_flags": RegexFlag.I | RegexFlag.M | RegexFlag.X
|
|
264
|
+
```
|
|
265
|
+
before_date
|
|
266
|
+
|
|
267
|
+
Value must be strictly before the given datetime.
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
validate(datetime(1999, 8, 29), {"before_date": datetime(2000, 1, 1)})
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
after_date
|
|
274
|
+
|
|
275
|
+
Value must be strictly after the given datetime.
|
|
276
|
+
```python
|
|
277
|
+
validate(datetime(2026, 8, 29), {"after_date": datetime(2000, 1, 1)})
|
|
264
278
|
```
|
|
265
279
|
|
|
266
280
|
must_be_true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|