ycleptic 2.0.2__tar.gz → 2.0.4__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.4/.github/workflows/release.yaml +91 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/.github/workflows/update_docs_only.yaml +1 -1
- {ycleptic-2.0.2 → ycleptic-2.0.4}/.gitignore +8 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/.readthedocs.yaml +3 -1
- ycleptic-2.0.4/CHANGELOG.md +139 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/PKG-INFO +33 -46
- ycleptic-2.0.4/README.md +41 -0
- ycleptic-2.0.4/docs/requirements.txt +8 -0
- ycleptic-2.0.4/docs/source/changelog.md +5 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/conf.py +1 -1
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/index.rst +2 -1
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/class.rst +3 -3
- ycleptic-2.0.4/docs/source/usage/yclept_makedoc.rst +92 -0
- ycleptic-2.0.4/docs/source/usage.rst +15 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/pyproject.toml +11 -2
- ycleptic-2.0.4/scripts/release.sh +88 -0
- ycleptic-2.0.4/tests/test_set.py +435 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/__init__.py +3 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/cli.py +3 -1
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/dictthings.py +5 -4
- ycleptic-2.0.4/ycleptic/makedoc.py +148 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/stringthings.py +2 -1
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/walkers.py +13 -11
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/yclept.py +27 -15
- ycleptic-2.0.2/.github/workflows/release.yaml +0 -41
- ycleptic-2.0.2/MANIFEST.in +0 -1
- ycleptic-2.0.2/README.md +0 -82
- ycleptic-2.0.2/docs/requirements.txt +0 -15
- ycleptic-2.0.2/docs/source/usage/yclept_makedoc.rst +0 -42
- ycleptic-2.0.2/docs/source/usage.rst +0 -15
- ycleptic-2.0.2/tests/test_set/console-out.txt +0 -8
- ycleptic-2.0.2/tests/test_set/example1.yaml +0 -15
- ycleptic-2.0.2/tests/test_set/user-dump.yaml +0 -29
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_1/attribute_1_1.rst +0 -15
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_1.rst +0 -24
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_2/attribute_2a/d2_a_dict.rst +0 -15
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_2/attribute_2a.rst +0 -26
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_2/attribute_2b.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_2.rst +0 -19
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1/attribute_3_1_1_1.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_1/attribute_3_1_1.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_1.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322a.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_2/d322/d322b.rst +0 -16
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_2/d322.rst +0 -19
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3/attribute_3_2.rst +0 -18
- ycleptic-2.0.2/tests/test_set/ydoc/attribute_3.rst +0 -19
- ycleptic-2.0.2/tests/test_set/ydoc.rst +0 -28
- ycleptic-2.0.2/tests/test_set.py +0 -376
- ycleptic-2.0.2/ycleptic/makedoc.py +0 -135
- {ycleptic-2.0.2 → ycleptic-2.0.4}/LICENSE +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/Makefile +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/make.bat +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/_static/css/custom.css +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/about.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/API.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.cli.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.dictthings.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.makedoc.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.resources.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.stringthings.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.walkers.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/api/ycleptic.yclept.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/installation.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/interactive_help.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/resource_file.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/the_base_config.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/the_user_config.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/docs/source/usage/yclept_config-help.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/pytest.ini +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/conftest.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/README.md +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/config.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/data/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/data/base.yaml +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/docs/source/intro.rst +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/mypackage/otherstuff/stuff.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/tests/test_set/test_package/rootdir/setup.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/resources/__init__.py +0 -0
- {ycleptic-2.0.2 → ycleptic-2.0.4}/ycleptic/resources/example_base.yaml +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Release & Upload to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
release:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
id-token: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v4
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install package and test dependencies
|
|
28
|
+
run: pip install -e ".[test]"
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: python -m pytest tests/
|
|
32
|
+
|
|
33
|
+
- name: Install Hatch
|
|
34
|
+
run: python -m pip install --upgrade hatch
|
|
35
|
+
|
|
36
|
+
- name: Verify tag matches pyproject version and CHANGELOG
|
|
37
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
38
|
+
run: |
|
|
39
|
+
TAG="${GITHUB_REF_NAME#v}"
|
|
40
|
+
VER="$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')"
|
|
41
|
+
echo "Tag version: $TAG"
|
|
42
|
+
echo "Project version: $VER"
|
|
43
|
+
test "$TAG" = "$VER" || { echo "ERROR: tag $TAG != pyproject version $VER"; exit 1; }
|
|
44
|
+
grep -q "^## \[$VER\]" CHANGELOG.md || { echo "ERROR: no CHANGELOG entry for $VER"; exit 1; }
|
|
45
|
+
|
|
46
|
+
- name: Clean previous builds
|
|
47
|
+
run: rm -rf dist/
|
|
48
|
+
|
|
49
|
+
- name: Build the package with Hatch
|
|
50
|
+
run: hatch build
|
|
51
|
+
|
|
52
|
+
- name: Extract release notes from CHANGELOG.md
|
|
53
|
+
run: |
|
|
54
|
+
echo 'RELEASE_BODY<<EOF' >> $GITHUB_ENV
|
|
55
|
+
awk '
|
|
56
|
+
BEGIN {found=0; capture=0}
|
|
57
|
+
/^## \[Unreleased\]/ {next}
|
|
58
|
+
/^## \[/ {
|
|
59
|
+
if (found) exit;
|
|
60
|
+
found = 1;
|
|
61
|
+
capture = 1;
|
|
62
|
+
next
|
|
63
|
+
}
|
|
64
|
+
/^## / {capture=0}
|
|
65
|
+
capture {print}
|
|
66
|
+
' CHANGELOG.md >> $GITHUB_ENV
|
|
67
|
+
echo 'EOF' >> $GITHUB_ENV
|
|
68
|
+
|
|
69
|
+
- name: Create GitHub Release
|
|
70
|
+
uses: softprops/action-gh-release@v2
|
|
71
|
+
with:
|
|
72
|
+
tag_name: ${{ github.ref_name }}
|
|
73
|
+
name: Release ${{ github.ref_name }}
|
|
74
|
+
body: ${{ env.RELEASE_BODY }}
|
|
75
|
+
files: |
|
|
76
|
+
dist/*.tar.gz
|
|
77
|
+
dist/*.whl
|
|
78
|
+
|
|
79
|
+
- name: Publish to PyPI
|
|
80
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
81
|
+
with:
|
|
82
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
83
|
+
|
|
84
|
+
- name: Trigger ReadTheDocs build
|
|
85
|
+
run: |
|
|
86
|
+
curl -X POST \
|
|
87
|
+
-H "Authorization: Token ${{ secrets.RTD_SECRET }}" \
|
|
88
|
+
https://readthedocs.org/api/v3/projects/ycleptic/versions/latest/builds/
|
|
89
|
+
curl -X POST \
|
|
90
|
+
-H "Authorization: Token ${{ secrets.RTD_SECRET }}" \
|
|
91
|
+
https://readthedocs.org/api/v3/projects/ycleptic/versions/${{ github.ref_name }}/builds/
|
|
@@ -78,6 +78,14 @@ instance/
|
|
|
78
78
|
docs/_build/
|
|
79
79
|
docs/source/_build
|
|
80
80
|
|
|
81
|
+
# Test-generated output files
|
|
82
|
+
tests/test_set/example1.yaml
|
|
83
|
+
tests/test_set/user-dump.yaml
|
|
84
|
+
tests/test_set/console-out.txt
|
|
85
|
+
tests/test_set/ydoc.rst
|
|
86
|
+
tests/test_set/ydoc/
|
|
87
|
+
tests/test_set/rcfile.yaml
|
|
88
|
+
|
|
81
89
|
# PyBuilder
|
|
82
90
|
target/
|
|
83
91
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
version: 2
|
|
2
2
|
|
|
3
3
|
build:
|
|
4
|
-
os: ubuntu-
|
|
4
|
+
os: ubuntu-24.04
|
|
5
5
|
tools:
|
|
6
6
|
python: "3.12"
|
|
7
7
|
jobs:
|
|
8
8
|
pre_build:
|
|
9
|
+
- rm -rf docs/source/api/
|
|
9
10
|
- sphinx-apidoc -f -M -e --implicit-namespaces --tocfile API -o docs/source/api ycleptic/
|
|
11
|
+
- yclept make-doc ycleptic/resources/example_base.yaml --root docs/source/example_config --footer-style raw-html
|
|
10
12
|
|
|
11
13
|
sphinx:
|
|
12
14
|
configuration: docs/source/conf.py
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [2.0.4] - 2026-05-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- RTD workflow was triggering docs builds on wrong project (`pidibble` instead of `ycleptic`)
|
|
14
|
+
- README Contributing section linked to a different repository's fork page
|
|
15
|
+
- `test_makedoc` expected string was stale (`"Single-valued parameters:"` → `"Single-valued attributes:"`)
|
|
16
|
+
- Bare `except:` clauses in `walkers.py` narrowed to `except ValueError:`
|
|
17
|
+
- Mutable default arguments `userdict={}` and `new_data={}` in `Yclept` replaced with `None`-defaulted parameters
|
|
18
|
+
- `exit(0)` in `_endhelp` replaced with `sys.exit(0)`
|
|
19
|
+
- `D["name"]` in `walkers.dwalk` raised `KeyError` at the root config level; replaced with `D.get("name", "root")`
|
|
20
|
+
- `type(x) == list/dict` identity comparisons replaced with `isinstance()` throughout
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- `make-doc` subcommand and `make_doctree` now accept a path for `--root` (e.g. `docs/source/config_ref`), so the command can be run from the project root without a prior `cd docs/source`; `makedoc.py` refactored from `os.chdir()` traversal to `pathlib.Path` throughout
|
|
24
|
+
- Debug `print()` calls in `makedoc.py` and `conf.py` converted to `logging.debug()` and removed respectively
|
|
25
|
+
- `docs/requirements.txt` de-duplicated and dead dependencies (`recommonmark`, `commonmark`, `alabaster`, `sphinx-rtd-theme`, `pillow`, `mock`) removed
|
|
26
|
+
- `cli.py` `config_help` now has a safe fallback for `write_func` when an unrecognized value is passed
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- `from __future__ import annotations` added to all source modules for Python 3.7/3.8 annotation compatibility
|
|
30
|
+
- `logging.NullHandler()` registered in package `__init__` per library logging best practices
|
|
31
|
+
- `pytest` step added to release workflow before PyPI publish
|
|
32
|
+
- Test suite expanded from 9 to 29 tests; `tearDown` added for automatic cleanup of generated files
|
|
33
|
+
- Test-generated output files added to `.gitignore`
|
|
34
|
+
- This changelog
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## [2.0.3] - 2025-09-04
|
|
39
|
+
|
|
40
|
+
- Renamed `directive` to `attribute` throughout codebase and documentation
|
|
41
|
+
|
|
42
|
+
## [2.0.2] - 2025-09-04
|
|
43
|
+
|
|
44
|
+
- Refactored `make_doc` internal path-handling logic
|
|
45
|
+
|
|
46
|
+
## [2.0.1] - 2025-08-22
|
|
47
|
+
|
|
48
|
+
- Documentation updates
|
|
49
|
+
|
|
50
|
+
## [1.9.0] - 2025-08-18
|
|
51
|
+
|
|
52
|
+
- Added `update_user` method to `Yclept`
|
|
53
|
+
|
|
54
|
+
## [1.8.1] - 2025-08-04
|
|
55
|
+
|
|
56
|
+
- Fixed faulty special update of dict-like values with defaults
|
|
57
|
+
|
|
58
|
+
## [1.8.0] - 2025-07-29
|
|
59
|
+
|
|
60
|
+
- More informative error messages via `raise_clean`
|
|
61
|
+
|
|
62
|
+
## [1.7.0] - 2025-07-16
|
|
63
|
+
|
|
64
|
+
- Restructured code-base and expanded documentation
|
|
65
|
+
|
|
66
|
+
## [1.6.2] - 2025-06-18
|
|
67
|
+
|
|
68
|
+
- Added `--footer-style` argument to `make-doc` CLI command
|
|
69
|
+
|
|
70
|
+
## [1.6.1] - 2025-06-18
|
|
71
|
+
|
|
72
|
+
- Version and configuration housekeeping
|
|
73
|
+
|
|
74
|
+
## [1.6.0] - 2025-06-18
|
|
75
|
+
|
|
76
|
+
- Internal release
|
|
77
|
+
|
|
78
|
+
## [1.5.0] - 2025-06-15
|
|
79
|
+
|
|
80
|
+
- Added `example` subfield to `docs` attribute specification
|
|
81
|
+
|
|
82
|
+
## [1.4.1] - 2025-05-21
|
|
83
|
+
|
|
84
|
+
- Enabled `case_sensitive` boolean for all `str`-type attributes
|
|
85
|
+
|
|
86
|
+
## [1.4.0] - 2025-05-21
|
|
87
|
+
|
|
88
|
+
- Initial implementation of `case_sensitive` attribute
|
|
89
|
+
|
|
90
|
+
## [1.3.0] - 2025-04-01
|
|
91
|
+
|
|
92
|
+
- `Yclept.__init__` now accepts a `userdict` dict in addition to a file path
|
|
93
|
+
|
|
94
|
+
## [1.2.0] - 2025-02-10
|
|
95
|
+
|
|
96
|
+
- `make-doc` subcommand now emits RST cross-reference links at the top of every generated RST file
|
|
97
|
+
|
|
98
|
+
## [1.1.0]
|
|
99
|
+
|
|
100
|
+
- Fixed: default values now shown for dict-type attributes in `console_help`
|
|
101
|
+
- Fixed: `choices` validation now works with integer choices
|
|
102
|
+
|
|
103
|
+
## [1.0.7]
|
|
104
|
+
|
|
105
|
+
- Fixed bad string in doc builder
|
|
106
|
+
|
|
107
|
+
## [1.0.6]
|
|
108
|
+
|
|
109
|
+
- Implemented interactive help mode
|
|
110
|
+
- Added `config-help` CLI subcommand
|
|
111
|
+
- Added `make-doc` CLI subcommand
|
|
112
|
+
|
|
113
|
+
## [1.0.5]
|
|
114
|
+
|
|
115
|
+
- Added support for a user dotfile/rcfile
|
|
116
|
+
|
|
117
|
+
## [1.0.4]
|
|
118
|
+
|
|
119
|
+
- Added `**kwargs` to `console_help` to allow `write_func` override
|
|
120
|
+
|
|
121
|
+
## [1.0.3.3]
|
|
122
|
+
|
|
123
|
+
- Fixed spurious output
|
|
124
|
+
|
|
125
|
+
## [1.0.3.2]
|
|
126
|
+
|
|
127
|
+
- Fixed version detection bug
|
|
128
|
+
|
|
129
|
+
## [1.0.2]
|
|
130
|
+
|
|
131
|
+
- Updated documentation; added version detection
|
|
132
|
+
|
|
133
|
+
## [1.0.1]
|
|
134
|
+
|
|
135
|
+
- Added example base config resource
|
|
136
|
+
|
|
137
|
+
## [1.0.0]
|
|
138
|
+
|
|
139
|
+
- Initial release
|
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ycleptic
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
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/
|
|
7
7
|
Project-URL: Bug Tracker, https://github.com/cameronabrams/ycleptic/issues
|
|
8
8
|
Author-email: Cameron F Abrams <cfa22@drexel.edu>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2022 Cameron Abrams
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
9
30
|
License-File: LICENSE
|
|
10
31
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
32
|
Classifier: Operating System :: OS Independent
|
|
12
33
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
39
|
+
Requires-Python: >=3.9
|
|
14
40
|
Requires-Dist: pyyaml>=6
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pytest; extra == 'test'
|
|
15
43
|
Description-Content-Type: text/markdown
|
|
16
44
|
|
|
17
45
|
# Ycleptic
|
|
@@ -34,49 +62,8 @@ pip install ycleptic
|
|
|
34
62
|
Once installed, the developer has access to the ``Yclept`` class.
|
|
35
63
|
|
|
36
64
|
## Release History
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* 1.9.0
|
|
40
|
-
* new `update_user` method
|
|
41
|
-
* 1.8.1
|
|
42
|
-
* fixed faulty special update of dict-like values with defaults
|
|
43
|
-
* 1.8.0
|
|
44
|
-
* more informative error messages via `raise_clean`
|
|
45
|
-
* 1.7.0
|
|
46
|
-
* Restructured code-base and expanded documentation
|
|
47
|
-
* 1.6.2
|
|
48
|
-
* `footer-style` argument added to `make-docs`
|
|
49
|
-
* 1.5.0
|
|
50
|
-
* `example` subfield in `docs` directive enabled
|
|
51
|
-
* 1.4.1
|
|
52
|
-
* `case_sensitive` boolean attribute enabled for all `str`-types
|
|
53
|
-
* 1.3.0
|
|
54
|
-
* `__init__` optionally accepts a dict instead of only a file name
|
|
55
|
-
* 1.2.0
|
|
56
|
-
* `make-doc` subcommand upgraded to put RST links at the top of every RST file
|
|
57
|
-
* 1.1.0
|
|
58
|
-
* bugfix: shows default values for any dict-type parameters
|
|
59
|
-
* bugfix: `choices` in interactive help did not work with integer choices
|
|
60
|
-
* 1.0.7
|
|
61
|
-
* bugfix: bad string in doc builder
|
|
62
|
-
* 1.0.6
|
|
63
|
-
* interactive mode implemented
|
|
64
|
-
* `config-help` subcommand added
|
|
65
|
-
* `make-doc` subcommand added
|
|
66
|
-
* 1.0.5
|
|
67
|
-
* added support for a user dotfile/rcfile
|
|
68
|
-
* 1.0.4
|
|
69
|
-
* added `**kwargs` to `console_help` to allow override of `print`
|
|
70
|
-
* 1.0.3.3
|
|
71
|
-
* fixed spurious output
|
|
72
|
-
* 1.0.3.2
|
|
73
|
-
* fixed version detection bug
|
|
74
|
-
* 1.0.2
|
|
75
|
-
* Updated documentation; added version detection
|
|
76
|
-
* 1.0.1
|
|
77
|
-
* Include example base config
|
|
78
|
-
* 1.0.0
|
|
79
|
-
* Initial version
|
|
65
|
+
|
|
66
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
80
67
|
|
|
81
68
|
## Meta
|
|
82
69
|
|
|
@@ -90,7 +77,7 @@ Distributed under the MIT license. See ``LICENSE`` for more information.
|
|
|
90
77
|
|
|
91
78
|
## Contributing
|
|
92
79
|
|
|
93
|
-
1. Fork it (<https://github.com/
|
|
80
|
+
1. Fork it (<https://github.com/cameronabrams/ycleptic/fork>)
|
|
94
81
|
2. Create your feature branch (`git checkout -b feature/fooBar`)
|
|
95
82
|
3. Commit your changes (`git commit -am 'Add some fooBar'`)
|
|
96
83
|
4. Push to the branch (`git push origin feature/fooBar`)
|
ycleptic-2.0.4/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Ycleptic
|
|
2
|
+
> YAML configuration generator
|
|
3
|
+
|
|
4
|
+
YAML is a popular markup language for input files, with its easy syntax and clear
|
|
5
|
+
mapping to lists and dicts. Ycleptic allows a developer to specify all keys, datatypes,
|
|
6
|
+
default values, choice restrictions, and other features of YAML-format input
|
|
7
|
+
files for use in their own apps. This makes the specification of input file syntax on top
|
|
8
|
+
of YAML for any particular application a bit easier than just using pure YAML. In addition,
|
|
9
|
+
ycleptic can also automatically build the RST/Sphinx doctree for your app's configuration
|
|
10
|
+
file.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install ycleptic
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Once installed, the developer has access to the ``Yclept`` class.
|
|
19
|
+
|
|
20
|
+
## Release History
|
|
21
|
+
|
|
22
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
23
|
+
|
|
24
|
+
## Meta
|
|
25
|
+
|
|
26
|
+
Cameron F. Abrams – cfa22@drexel.edu
|
|
27
|
+
|
|
28
|
+
Distributed under the MIT license. See ``LICENSE`` for more information.
|
|
29
|
+
|
|
30
|
+
[https://github.com/cameronabrams](https://github.com/cameronabrams/)
|
|
31
|
+
|
|
32
|
+
[https://github.com/AbramsGroup](https://github.com/AbramsGroup/)
|
|
33
|
+
|
|
34
|
+
## Contributing
|
|
35
|
+
|
|
36
|
+
1. Fork it (<https://github.com/cameronabrams/ycleptic/fork>)
|
|
37
|
+
2. Create your feature branch (`git checkout -b feature/fooBar`)
|
|
38
|
+
3. Commit your changes (`git commit -am 'Add some fooBar'`)
|
|
39
|
+
4. Push to the branch (`git push origin feature/fooBar`)
|
|
40
|
+
5. Create a new Pull Request
|
|
41
|
+
|
|
@@ -21,6 +21,7 @@ extensions = [
|
|
|
21
21
|
'sphinxcontrib.mermaid',
|
|
22
22
|
'sphinx.ext.napoleon',
|
|
23
23
|
'sphinx.ext.viewcode',
|
|
24
|
+
'myst_parser',
|
|
24
25
|
]
|
|
25
26
|
|
|
26
27
|
autosummary_generate = True # Enable autosummary tables
|
|
@@ -79,5 +80,4 @@ epub_show_urls = 'footnote'
|
|
|
79
80
|
mermaid_params = ['--theme', 'dark', '--width', '600']
|
|
80
81
|
|
|
81
82
|
def setup(app):
|
|
82
|
-
print("✅ Setting up custom directives...")
|
|
83
83
|
app.add_css_file("css/custom.css")
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
``Yclept`` Class
|
|
4
4
|
====================
|
|
5
5
|
|
|
6
|
-
Installation of Ycleptic gives access to the :class:`Yclept` class.
|
|
6
|
+
Installation of Ycleptic gives access to the :class:`ycleptic.yclept.Yclept` class.
|
|
7
7
|
|
|
8
|
-
The :class:`Yclept` class is meant to be used inside any Python package where the developer
|
|
8
|
+
The :class:`ycleptic.yclept.Yclept` class is meant to be used inside any Python package where the developer
|
|
9
9
|
wants to specify the allowed formats, expected values, default values, required
|
|
10
10
|
values, etc., of a YAML-format configuration file for the developer's app.
|
|
11
11
|
|
|
@@ -30,7 +30,7 @@ To use ``ycleptic`` in your app, you must create a base configuration file that
|
|
|
30
30
|
|
|
31
31
|
``base.yaml`` is a base configuration file. More about that file in a moment.
|
|
32
32
|
|
|
33
|
-
You then might like to create a "config" class for your package that inherits :class:`Yclept`, and initialize it with your base config and a user config. For example:
|
|
33
|
+
You then might like to create a "config" class for your package that inherits :class:`ycleptic.yclept.Yclept`, and initialize it with your base config and a user config. For example:
|
|
34
34
|
|
|
35
35
|
.. code-block:: python
|
|
36
36
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.. _usage_yclept_makedoc:
|
|
2
|
+
|
|
3
|
+
``yclept make-doc``
|
|
4
|
+
===================
|
|
5
|
+
|
|
6
|
+
The ``yclept make-doc`` command generates a Sphinx RST document tree from your
|
|
7
|
+
base configuration file.
|
|
8
|
+
|
|
9
|
+
Basic usage
|
|
10
|
+
-----------
|
|
11
|
+
|
|
12
|
+
Given a package structured like this:
|
|
13
|
+
|
|
14
|
+
.. code-block:: text
|
|
15
|
+
|
|
16
|
+
myproject/
|
|
17
|
+
├── mypackage/
|
|
18
|
+
│ ├── data/
|
|
19
|
+
│ │ ├── base.yaml
|
|
20
|
+
│ │ └── __init__.py
|
|
21
|
+
│ └── __init__.py
|
|
22
|
+
├── docs/
|
|
23
|
+
│ └── source/
|
|
24
|
+
│ └── intro.rst
|
|
25
|
+
└── pyproject.toml
|
|
26
|
+
|
|
27
|
+
Run ``yclept make-doc`` from the project root, passing the full path to both
|
|
28
|
+
the base config file and the desired output location:
|
|
29
|
+
|
|
30
|
+
.. code-block:: console
|
|
31
|
+
|
|
32
|
+
$ yclept make-doc mypackage/data/base.yaml --root docs/source/config_ref
|
|
33
|
+
|
|
34
|
+
This writes ``docs/source/config_ref.rst`` and populates
|
|
35
|
+
``docs/source/config_ref/`` with one RST file per attribute, mirroring the
|
|
36
|
+
nesting of your base config. No ``cd`` into ``docs/source`` is required.
|
|
37
|
+
|
|
38
|
+
Then add ``config_ref`` to your Sphinx ``toctree``:
|
|
39
|
+
|
|
40
|
+
.. code-block:: rst
|
|
41
|
+
|
|
42
|
+
.. toctree::
|
|
43
|
+
:maxdepth: 1
|
|
44
|
+
|
|
45
|
+
config_ref
|
|
46
|
+
|
|
47
|
+
For a live example of the output, see
|
|
48
|
+
`pestifer's configuration reference <https://pestifer.readthedocs.io/en/latest/config_ref.html>`_,
|
|
49
|
+
which is generated entirely by ``yclept make-doc``.
|
|
50
|
+
|
|
51
|
+
ReadTheDocs integration
|
|
52
|
+
-----------------------
|
|
53
|
+
|
|
54
|
+
To regenerate the doc tree on every RTD build, add the command to the
|
|
55
|
+
``pre_build`` jobs in ``.readthedocs.yaml``:
|
|
56
|
+
|
|
57
|
+
.. code-block:: yaml
|
|
58
|
+
|
|
59
|
+
build:
|
|
60
|
+
os: ubuntu-24.04
|
|
61
|
+
tools:
|
|
62
|
+
python: "3.12"
|
|
63
|
+
jobs:
|
|
64
|
+
pre_build:
|
|
65
|
+
- yclept make-doc mypackage/data/base.yaml --root docs/source/config_ref --footer-style raw-html
|
|
66
|
+
|
|
67
|
+
Footer styles
|
|
68
|
+
-------------
|
|
69
|
+
|
|
70
|
+
Each generated RST file ends with a footer whose appearance is controlled by
|
|
71
|
+
``--footer-style``. The available styles are:
|
|
72
|
+
|
|
73
|
+
``paragraph`` (default)
|
|
74
|
+
A horizontal rule followed by a plain paragraph.
|
|
75
|
+
|
|
76
|
+
.. code-block:: rst
|
|
77
|
+
|
|
78
|
+
----
|
|
79
|
+
|
|
80
|
+
This page was automatically generated by **ycleptic** v2.0.3 on 2025-09-04.
|
|
81
|
+
|
|
82
|
+
``comment``
|
|
83
|
+
An RST comment — present in the source but invisible in the rendered output.
|
|
84
|
+
|
|
85
|
+
``note``
|
|
86
|
+
A Sphinx ``.. note::`` directive.
|
|
87
|
+
|
|
88
|
+
``rubric``
|
|
89
|
+
A ``.. rubric::`` heading outside the normal document hierarchy.
|
|
90
|
+
|
|
91
|
+
``raw-html``
|
|
92
|
+
A ``.. raw:: html`` block, useful for styled footers with CSS classes.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Usage
|
|
2
|
+
=====
|
|
3
|
+
|
|
4
|
+
``Ycleptic`` primarily exposes the :class:`ycleptic.yclept.Yclept` class to inherit in your own applications. It also has a command-line interface with two subcommands: ``yclept config-help`` and ``yclept make-doc``. The former provides interactive help for the configuration file, and the latter generates documentation from the base configuration file.
|
|
5
|
+
|
|
6
|
+
.. toctree::
|
|
7
|
+
:maxdepth: 1
|
|
8
|
+
|
|
9
|
+
usage/class
|
|
10
|
+
usage/the_base_config
|
|
11
|
+
usage/the_user_config
|
|
12
|
+
usage/interactive_help
|
|
13
|
+
usage/resource_file
|
|
14
|
+
usage/yclept_config-help
|
|
15
|
+
usage/yclept_makedoc
|
|
@@ -3,21 +3,30 @@ requires = ["hatchling"]
|
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
[project]
|
|
5
5
|
name = "ycleptic"
|
|
6
|
-
version = "2.0.
|
|
6
|
+
version = "2.0.4"
|
|
7
7
|
authors = [
|
|
8
8
|
{ name="Cameron F Abrams", email="cfa22@drexel.edu" },
|
|
9
9
|
]
|
|
10
10
|
description = "A YAML-format configuration generator"
|
|
11
11
|
readme = "README.md"
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
license = {file = "LICENSE"}
|
|
13
14
|
classifiers = [
|
|
14
15
|
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.9",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
15
21
|
"License :: OSI Approved :: MIT License",
|
|
16
22
|
"Operating System :: OS Independent",
|
|
17
23
|
]
|
|
18
24
|
dependencies = [
|
|
19
25
|
"pyyaml>=6"
|
|
20
26
|
]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
test = ["pytest"]
|
|
21
30
|
[project.scripts]
|
|
22
31
|
yclept = "ycleptic.cli:cli"
|
|
23
32
|
[project.urls]
|