evalidate 2.1.1__tar.gz → 2.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evalidate
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: Validation and secure evaluation of untrusted python expressions
5
5
  Project-URL: Homepage, https://github.com/yaroslaff/evalidate
6
6
  Project-URL: Issues, https://github.com/yaroslaff/evalidate/issues
@@ -11,7 +11,8 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Requires-Python: >=3.8
14
- Requires-Dist: faker
14
+ Provides-Extra: generate
15
+ Requires-Dist: faker; extra == 'generate'
15
16
  Description-Content-Type: text/markdown
16
17
 
17
18
  # Evalidate
@@ -163,6 +164,8 @@ Example record:
163
164
  }
164
165
  ```
165
166
 
167
+ To use genfakeproducts, you need to install evalidate with "generate" extra: `pip3 install evalidate[generate]`
168
+
166
169
  ### jg (grep)
167
170
  `jg` is a very fast JSON grep CLI tool. It accepts a Python expression and a filename, or reads from stdin:
168
171
 
@@ -147,6 +147,8 @@ Example record:
147
147
  }
148
148
  ```
149
149
 
150
+ To use genfakeproducts, you need to install evalidate with "generate" extra: `pip3 install evalidate[generate]`
151
+
150
152
  ### jg (grep)
151
153
  `jg` is a very fast JSON grep CLI tool. It accepts a Python expression and a filename, or reads from stdin:
152
154
 
@@ -6,7 +6,7 @@ import ast
6
6
  import dataclasses
7
7
  from typing import Callable
8
8
 
9
- __version__ = '2.1.1'
9
+ __version__ = '2.1.2'
10
10
 
11
11
 
12
12
  class EvalException(Exception):
@@ -11,10 +11,15 @@ Example:
11
11
 
12
12
  import argparse, json, random, uuid
13
13
  from datetime import datetime, UTC
14
- from faker import Faker
14
+ try:
15
+ from faker import Faker
16
+ except ImportError:
17
+ print("Faker library is required. You can reinstall evalidate with the 'generate' extra: pipx install 'evalidate[generate]'")
18
+ exit(1)
15
19
 
16
20
  fake = Faker()
17
21
 
22
+
18
23
  BRANDS = {
19
24
  "phones": ["Samsung", "Apple", "Xiaomi", "OnePlus", "Google"],
20
25
  "laptops": ["Dell", "HP", "Lenovo", "Asus", "Acer", "Apple"],
@@ -10,7 +10,7 @@ name="evalidate"
10
10
  dynamic = [ "version" ]
11
11
  keywords = ["python", "security", "json", "sandbox", "filter", "evaluation", "expression", "secure", "jq", "jg", "validate", "safe", "grep", "eval", "evaluate", "jg"]
12
12
 
13
- dependencies = ['faker']
13
+ dependencies = []
14
14
  authors = [
15
15
  { name="Yaroslav Polyakov", email="yaroslaff@gmail.com" },
16
16
  ]
@@ -23,6 +23,10 @@ classifiers = [
23
23
  "Operating System :: OS Independent",
24
24
  ]
25
25
 
26
+ [project.optional-dependencies]
27
+ generate = ["faker"]
28
+
29
+
26
30
  [project.urls]
27
31
  Homepage = "https://github.com/yaroslaff/evalidate"
28
32
  Issues = "https://github.com/yaroslaff/evalidate/issues"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes