ycleptic 2.0.2__tar.gz → 2.0.3__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.
- {ycleptic-2.0.2 → ycleptic-2.0.3}/PKG-INFO +2 -2
- {ycleptic-2.0.2 → ycleptic-2.0.3}/README.md +1 -1
- {ycleptic-2.0.2 → ycleptic-2.0.3}/pyproject.toml +1 -1
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/dictthings.py +1 -1
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/walkers.py +7 -7
- {ycleptic-2.0.2 → ycleptic-2.0.3}/.github/workflows/release.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/.github/workflows/update_docs_only.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/.gitignore +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/.readthedocs.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/LICENSE +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/MANIFEST.in +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/Makefile +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/make.bat +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/requirements.txt +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/_static/css/custom.css +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/about.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/API.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.cli.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.dictthings.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.makedoc.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.resources.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.stringthings.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.walkers.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/api/ycleptic.yclept.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/conf.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/index.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/installation.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/class.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/interactive_help.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/resource_file.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/the_base_config.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/the_user_config.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/yclept_config-help.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage/yclept_makedoc.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/docs/source/usage.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/pytest.ini +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/conftest.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/console-out.txt +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/example1.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/README.md +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/config.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/base.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/docs/source/intro.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/otherstuff/stuff.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/setup.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/user-dump.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_1/attribute_1_1.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_1.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2a/d2_a_dict.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2a.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2b.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1/attribute_3_1_1_1.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322a.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322b.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/cli.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/makedoc.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/resources/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/resources/example_base.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/stringthings.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.3}/ycleptic/yclept.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ycleptic
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: A YAML-format configuration generator
|
|
5
5
|
Project-URL: Source, https://github.com/cameronabrams/ycleptic
|
|
6
6
|
Project-URL: Documentation, https://ycleptic.readthedocs.io/en/latest/
|
|
@@ -34,7 +34,7 @@ pip install ycleptic
|
|
|
34
34
|
Once installed, the developer has access to the ``Yclept`` class.
|
|
35
35
|
|
|
36
36
|
## Release History
|
|
37
|
-
* 2.0.
|
|
37
|
+
* 2.0.3
|
|
38
38
|
* refactored to change `directive` to `attribute` throughout
|
|
39
39
|
* 1.9.0
|
|
40
40
|
* new `update_user` method
|
|
@@ -93,7 +93,7 @@ def dwalk(D: dict, I: dict):
|
|
|
93
93
|
The user's config dictionary to be processed.
|
|
94
94
|
"""
|
|
95
95
|
if not 'attributes' in D:
|
|
96
|
-
raise ValueError(f'
|
|
96
|
+
raise ValueError(f'Attribute {D["name"]} has no attributes; cannot walk through it.')
|
|
97
97
|
# get the name of each config attribute at this level in this block
|
|
98
98
|
tld = [x['name'] for x in D['attributes']]
|
|
99
99
|
if I == None:
|
|
@@ -102,7 +102,7 @@ def dwalk(D: dict, I: dict):
|
|
|
102
102
|
ud = list(I.keys())
|
|
103
103
|
for u in ud:
|
|
104
104
|
if not u in tld:
|
|
105
|
-
raise_clean(ValueError(f'
|
|
105
|
+
raise_clean(ValueError(f'Attribute \'{u}\' invalid; expecting one of {tld} under \'{D["name"]}\'.'))
|
|
106
106
|
# logger.debug(f'dwalk along {tld} for {I}')
|
|
107
107
|
# for each attribute name
|
|
108
108
|
for d in tld:
|
|
@@ -114,7 +114,7 @@ def dwalk(D: dict, I: dict):
|
|
|
114
114
|
# get its type
|
|
115
115
|
typ = dx['type']
|
|
116
116
|
if typ == 'dict' and (d in I and not type(I[d]) == dict):
|
|
117
|
-
raise_clean(ValueError(f'
|
|
117
|
+
raise_clean(ValueError(f'Attribute \'{d}\' of \'{D["name"]}\' must be a dict; found {type(I[d])}.'))
|
|
118
118
|
# logger.debug(f' - {d} typ {typ} I {I[d]}
|
|
119
119
|
# logger.debug(f'- {d} typ {typ} I {I}')
|
|
120
120
|
# if this attribute name does not already have a key in the result
|
|
@@ -129,7 +129,7 @@ def dwalk(D: dict, I: dict):
|
|
|
129
129
|
# if it is flagged as required, die since it is not in the read-in
|
|
130
130
|
elif 'required' in dx:
|
|
131
131
|
if dx['required']:
|
|
132
|
-
raise_clean(ValueError(f'
|
|
132
|
+
raise_clean(ValueError(f'Attribute \'{d}\' of \'{D["name"]}\' requires a value.'))
|
|
133
133
|
# if it is a dict
|
|
134
134
|
elif typ == 'dict':
|
|
135
135
|
# if it is explicitly tagged as not required, do nothing
|
|
@@ -159,11 +159,11 @@ def dwalk(D: dict, I: dict):
|
|
|
159
159
|
if not case_sensitive:
|
|
160
160
|
# just check the choices that were provided by the user
|
|
161
161
|
if not I[d].casefold() in [x.casefold() for x in dx['choices']]:
|
|
162
|
-
raise_clean(ValueError(f'
|
|
162
|
+
raise_clean(ValueError(f'Attribute \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])} (case-insensitive); found \'{I[d]}\''))
|
|
163
163
|
else:
|
|
164
164
|
# check the choices that were provided by the user
|
|
165
165
|
if not I[d] in dx['choices']:
|
|
166
|
-
raise_clean(ValueError(f'
|
|
166
|
+
raise_clean(ValueError(f'Attribute \'{d}\' of \'{dx["name"]}\' must be one of {", ".join(dx["choices"])}; found \'{I[d]}\''))
|
|
167
167
|
elif typ == 'dict':
|
|
168
168
|
# process descendants
|
|
169
169
|
if 'attributes' in dx:
|
|
@@ -179,7 +179,7 @@ def dwalk(D: dict, I: dict):
|
|
|
179
179
|
I[d] = defaults + I[d]
|
|
180
180
|
elif typ == 'tuple':
|
|
181
181
|
if 'attributes' in dx:
|
|
182
|
-
raise_clean(TypeError(f'
|
|
182
|
+
raise_clean(TypeError(f'Attribute \'{d}\' of \'{D["name"]}\' cannot have subattributes.'))
|
|
183
183
|
I[d] = dx.get('default', ())
|
|
184
184
|
|
|
185
185
|
def lwalk(D: dict, L: list[dict]):
|
|
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
|
|
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
|
|
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
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/__init__.py
RENAMED
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/data/base.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/test_package/rootdir/mypackage/otherstuff/stuff.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_2/attribute_2a/d2_a_dict.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1.rst
RENAMED
|
File without changes
|
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322a.rst
RENAMED
|
File without changes
|
{ycleptic-2.0.2 → ycleptic-2.0.3}/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322b.rst
RENAMED
|
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
|