libentry 1.24.8__py3-none-any.whl → 1.24.9__py3-none-any.whl
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.
- libentry/argparse.py +21 -3
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/METADATA +1 -1
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/RECORD +8 -8
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/LICENSE +0 -0
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/WHEEL +0 -0
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/entry_points.txt +0 -0
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/top_level.txt +0 -0
- {libentry-1.24.8.dist-info → libentry-1.24.9.dist-info}/zip-safe +0 -0
libentry/argparse.py
CHANGED
@@ -14,9 +14,10 @@ __all__ = [
|
|
14
14
|
|
15
15
|
import argparse
|
16
16
|
import ast
|
17
|
+
import json
|
17
18
|
import re
|
18
19
|
from dataclasses import fields, is_dataclass
|
19
|
-
from typing import Optional, Sequence, Type, Union, get_args, get_origin
|
20
|
+
from typing import Dict, List, Optional, Sequence, Type, Union, get_args, get_origin
|
20
21
|
|
21
22
|
import yaml
|
22
23
|
from pydantic import BaseModel
|
@@ -158,12 +159,29 @@ class ArgumentParser(argparse.ArgumentParser):
|
|
158
159
|
instance=default_value
|
159
160
|
)
|
160
161
|
else:
|
162
|
+
desc = info.description + " " if info.description else ""
|
163
|
+
if info.is_required():
|
164
|
+
desc += "(required)"
|
165
|
+
else:
|
166
|
+
if default_value is None:
|
167
|
+
desc += "(default=None)"
|
168
|
+
elif isinstance(default_value, (str, int, float, bool)):
|
169
|
+
desc += f"(default={default_value})"
|
170
|
+
elif isinstance(default_value, (Dict, List)):
|
171
|
+
try:
|
172
|
+
desc += f"(default={json.dumps(default_value)})"
|
173
|
+
except TypeError:
|
174
|
+
default_type = type(default_value).__name__
|
175
|
+
desc += f"(default={default_type} object)"
|
176
|
+
else:
|
177
|
+
default_type = type(default_value).__name__
|
178
|
+
desc += f"(default={default_type} object)"
|
179
|
+
|
161
180
|
self.add_argument(
|
162
181
|
f"--{prefix}.{name}",
|
163
182
|
type=literal_eval,
|
164
183
|
default=DefaultValue(default_value),
|
165
|
-
|
166
|
-
help=info.description
|
184
|
+
help=desc
|
167
185
|
)
|
168
186
|
|
169
187
|
def parse_args(self, args=None, namespace=None):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
libentry/__init__.py,sha256=ko2YBIIx5H3dD0tedBkialzJGEDczFaP_PZmT1cIlak,148
|
2
2
|
libentry/api.py,sha256=UkXdBv9oqQhaSESRReLWEPj8venBUoCBppIg-FAXqKA,24146
|
3
|
-
libentry/argparse.py,sha256=
|
3
|
+
libentry/argparse.py,sha256=0_0_EJzLEgE8UFD8fEWCddGnDW1qxyMYMvcD3cuChvY,8882
|
4
4
|
libentry/dataclasses.py,sha256=AQV2PuxplJCwGZ5HKX72U-z-POUhTdy3XtpEK9KNIGQ,4541
|
5
5
|
libentry/executor.py,sha256=cTV0WxJi0nU1TP-cOwmeodN8DD6L1691M2HIQsJtGrU,6582
|
6
6
|
libentry/experiment.py,sha256=ejgAHDXWIe9x4haUzIFuz1WasLY0_aD1z_vyEVGjTu8,4922
|
@@ -22,10 +22,10 @@ libentry/service/list.py,sha256=ElHWhTgShGOhaxMUEwVbMXos0NQKjHsODboiQ-3AMwE,1397
|
|
22
22
|
libentry/service/running.py,sha256=FrPJoJX6wYxcHIysoatAxhW3LajCCm0Gx6l7__6sULQ,5105
|
23
23
|
libentry/service/start.py,sha256=mZT7b9rVULvzy9GTZwxWnciCHgv9dbGN2JbxM60OMn4,1270
|
24
24
|
libentry/service/stop.py,sha256=wOpwZgrEJ7QirntfvibGq-XsTC6b3ELhzRW2zezh-0s,1187
|
25
|
-
libentry-1.24.
|
26
|
-
libentry-1.24.
|
27
|
-
libentry-1.24.
|
28
|
-
libentry-1.24.
|
29
|
-
libentry-1.24.
|
30
|
-
libentry-1.24.
|
31
|
-
libentry-1.24.
|
25
|
+
libentry-1.24.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
26
|
+
libentry-1.24.9.dist-info/METADATA,sha256=LttWBo7s_rfqrsHN336XQWPOMKeHggHufl2q8i4ieos,1135
|
27
|
+
libentry-1.24.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
28
|
+
libentry-1.24.9.dist-info/entry_points.txt,sha256=1v_nLVDsjvVJp9SWhl4ef2zZrsLTBtFWgrYFgqvQBgc,61
|
29
|
+
libentry-1.24.9.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
|
30
|
+
libentry-1.24.9.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
31
|
+
libentry-1.24.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|