libentry 1.14__py3-none-any.whl → 1.15__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/schema.py CHANGED
@@ -87,7 +87,7 @@ def _parse_dict(context: ParseContext):
87
87
  key_type = "str"
88
88
  value_type = parse_type(dict_args[1], context.schemas)
89
89
  if isinstance(value_type, list):
90
- raise TypeError("\"Union\" cannot be used as the type of list elements.")
90
+ raise TypeError("\"Union\" cannot be used as the type of dict elements.")
91
91
  return f"Dict[{key_type},{value_type}]"
92
92
  else:
93
93
  return "Dict"
@@ -130,12 +130,16 @@ def _parse_base_model(context: ParseContext):
130
130
  assert isinstance(fields, Mapping)
131
131
  for name, field in fields.items():
132
132
  try:
133
+ default = field.default if field.default is not PydanticUndefined else None
134
+ title = field.title
135
+ if title is None:
136
+ title = "".join(word.capitalize() for word in name.split("_"))
133
137
  schema_field = SchemaField(
134
138
  name=name,
135
139
  type=parse_type(field.annotation, context.schemas),
136
- default=field.default if field.default is not PydanticUndefined else None,
140
+ default=default,
137
141
  is_required=field.is_required(),
138
- title="".join(word.capitalize() for word in name.split("_")),
142
+ title=title,
139
143
  description=field.description
140
144
  )
141
145
  except TypeError as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libentry
3
- Version: 1.14
3
+ Version: 1.15
4
4
  Summary: Entries for experimental utilities.
5
5
  Home-page: https://github.com/XoriieInpottn/libentry
6
6
  Author: xi
@@ -6,7 +6,7 @@ libentry/executor.py,sha256=cTV0WxJi0nU1TP-cOwmeodN8DD6L1691M2HIQsJtGrU,6582
6
6
  libentry/experiment.py,sha256=ejgAHDXWIe9x4haUzIFuz1WasLY0_aD1z_vyEVGjTu8,4922
7
7
  libentry/json.py,sha256=1-Kv5ZRb5dBrOTU84n6sZtYZV3xE-O6wEt_--ynbSaU,1209
8
8
  libentry/logging.py,sha256=IiYoCUzm8XTK1fduA-NA0FI2Qz_m81NEPV3d3tEfgdI,1349
9
- libentry/schema.py,sha256=zXqRsz9-29WdjVFJAJ4qJPyGerzRApHviMxfB1dE6bM,8024
9
+ libentry/schema.py,sha256=BO7EE7i43Cb4xn_OLsBM-HDwWOT6V5fPs91Am3QqnNQ,8178
10
10
  libentry/server.py,sha256=gYPoZXd0umlDYZf-6ZV0_vJadg3YQvnLDc6JFDJh9jc,1503
11
11
  libentry/service/__init__.py,sha256=1oLL20yLB1GL9IbFiZD8OReDqiCpFr-yetIR6x1cNkI,23
12
12
  libentry/service/common.py,sha256=OVaW2afgKA6YqstJmtnprBCqQEUZEWotZ6tHavmJJeU,42
@@ -15,9 +15,9 @@ libentry/service/list.py,sha256=ElHWhTgShGOhaxMUEwVbMXos0NQKjHsODboiQ-3AMwE,1397
15
15
  libentry/service/running.py,sha256=FrPJoJX6wYxcHIysoatAxhW3LajCCm0Gx6l7__6sULQ,5105
16
16
  libentry/service/start.py,sha256=mZT7b9rVULvzy9GTZwxWnciCHgv9dbGN2JbxM60OMn4,1270
17
17
  libentry/service/stop.py,sha256=wOpwZgrEJ7QirntfvibGq-XsTC6b3ELhzRW2zezh-0s,1187
18
- libentry-1.14.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
19
- libentry-1.14.dist-info/METADATA,sha256=rJKa26tvjSA1n7BQRQxGUnekJEROocjRIhpNAv8pTfM,791
20
- libentry-1.14.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
21
- libentry-1.14.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
22
- libentry-1.14.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
- libentry-1.14.dist-info/RECORD,,
18
+ libentry-1.15.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
19
+ libentry-1.15.dist-info/METADATA,sha256=Vlvcl_kB5qp_0xM_eLNJykdEzv0slsqh7LitUa-dpo4,791
20
+ libentry-1.15.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
21
+ libentry-1.15.dist-info/top_level.txt,sha256=u2uF6-X5fn2Erf9PYXOg_6tntPqTpyT-yzUZrltEd6I,9
22
+ libentry-1.15.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
23
+ libentry-1.15.dist-info/RECORD,,