yaml-compose 0.1.0__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.
- yaml_compose-0.1.0/.github/workflows/ci.yml +44 -0
- yaml_compose-0.1.0/.github/workflows/release.yml +69 -0
- yaml_compose-0.1.0/.gitignore +21 -0
- yaml_compose-0.1.0/.pre-commit-config.yaml +27 -0
- yaml_compose-0.1.0/CHANGELOG.md +22 -0
- yaml_compose-0.1.0/LICENSE +21 -0
- yaml_compose-0.1.0/MANIFEST.in +10 -0
- yaml_compose-0.1.0/PKG-INFO +563 -0
- yaml_compose-0.1.0/README.md +517 -0
- yaml_compose-0.1.0/docs/design-notes.md +102 -0
- yaml_compose-0.1.0/docs/examples.md +395 -0
- yaml_compose-0.1.0/docs/releasing.md +51 -0
- yaml_compose-0.1.0/pyproject.toml +117 -0
- yaml_compose-0.1.0/quality-gates.toml +111 -0
- yaml_compose-0.1.0/scripts/__init__.py +8 -0
- yaml_compose-0.1.0/scripts/check_build.py +28 -0
- yaml_compose-0.1.0/scripts/check_local.py +16 -0
- yaml_compose-0.1.0/scripts/check_pyright.py +26 -0
- yaml_compose-0.1.0/scripts/ci.py +182 -0
- yaml_compose-0.1.0/scripts/release.py +92 -0
- yaml_compose-0.1.0/setup.cfg +4 -0
- yaml_compose-0.1.0/src/yaml_compose/__init__.py +78 -0
- yaml_compose-0.1.0/src/yaml_compose/_overlays.py +114 -0
- yaml_compose-0.1.0/src/yaml_compose/_paths.py +58 -0
- yaml_compose-0.1.0/src/yaml_compose/_search.py +45 -0
- yaml_compose-0.1.0/src/yaml_compose/_streams.py +37 -0
- yaml_compose-0.1.0/src/yaml_compose/_unset.py +23 -0
- yaml_compose-0.1.0/src/yaml_compose/_yaml_loader.py +123 -0
- yaml_compose-0.1.0/src/yaml_compose/limits.py +129 -0
- yaml_compose-0.1.0/src/yaml_compose/loader.py +1100 -0
- yaml_compose-0.1.0/src/yaml_compose/py.typed +0 -0
- yaml_compose-0.1.0/src/yaml_compose/resolver.py +264 -0
- yaml_compose-0.1.0/src/yaml_compose/tags.py +44 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/PKG-INFO +563 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/SOURCES.txt +50 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/dependency_links.txt +1 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/requires.txt +23 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/scm_file_list.json +81 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/scm_version.json +8 -0
- yaml_compose-0.1.0/src/yaml_compose.egg-info/top_level.txt +1 -0
- yaml_compose-0.1.0/tests/conftest.py +30 -0
- yaml_compose-0.1.0/tests/test_ci.py +119 -0
- yaml_compose-0.1.0/tests/test_composition.py +452 -0
- yaml_compose-0.1.0/tests/test_examples.py +184 -0
- yaml_compose-0.1.0/tests/test_include_search.py +356 -0
- yaml_compose-0.1.0/tests/test_injected_resolver.py +328 -0
- yaml_compose-0.1.0/tests/test_limits.py +186 -0
- yaml_compose-0.1.0/tests/test_loader.py +603 -0
- yaml_compose-0.1.0/tests/test_release.py +102 -0
- yaml_compose-0.1.0/tests/test_semantics.py +404 -0
- yaml_compose-0.1.0/tests/test_unset.py +19 -0
- yaml_compose-0.1.0/tests/typecheck_sentinel.py +18 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
workflow_call:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-latest, windows-latest]
|
|
18
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
- uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
cache: pip
|
|
28
|
+
- run: python -m pip install --upgrade pip
|
|
29
|
+
- run: python -m pip install -e ".[test,lint]"
|
|
30
|
+
- run: python -m scripts.ci --python-only
|
|
31
|
+
|
|
32
|
+
quality:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
with:
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
- uses: actions/setup-python@v5
|
|
39
|
+
with:
|
|
40
|
+
python-version: "3.14"
|
|
41
|
+
cache: pip
|
|
42
|
+
- run: python -m pip install --upgrade pip
|
|
43
|
+
- run: python -m pip install -e ".[dev]"
|
|
44
|
+
- run: python -m scripts.ci --quality-only
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Publish release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: release-${{ github.event.release.tag_name }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
checks:
|
|
16
|
+
if: ${{ !github.event.release.prerelease }}
|
|
17
|
+
uses: ./.github/workflows/ci.yml
|
|
18
|
+
|
|
19
|
+
build:
|
|
20
|
+
needs: checks
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
ref: ${{ github.event.release.tag_name }}
|
|
27
|
+
- uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: "3.14"
|
|
30
|
+
cache: pip
|
|
31
|
+
- run: python -m pip install --upgrade pip
|
|
32
|
+
- run: python -m pip install -e ".[dev]"
|
|
33
|
+
- name: Build and validate release distributions
|
|
34
|
+
env:
|
|
35
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
36
|
+
run: python -m scripts.release build
|
|
37
|
+
- name: Smoke-test the installed wheel
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --no-deps --force-reinstall dist/*.whl
|
|
40
|
+
python -I - <<'PY'
|
|
41
|
+
from io import StringIO
|
|
42
|
+
from yaml_compose import load_yaml_compose
|
|
43
|
+
|
|
44
|
+
result = load_yaml_compose(
|
|
45
|
+
StringIO("items: [before, !spread [[one, two]], after]\n"),
|
|
46
|
+
)
|
|
47
|
+
assert result == {"items": ["before", "one", "two", "after"]}
|
|
48
|
+
PY
|
|
49
|
+
- uses: actions/upload-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: python-distributions
|
|
52
|
+
path: dist/*
|
|
53
|
+
if-no-files-found: error
|
|
54
|
+
|
|
55
|
+
publish:
|
|
56
|
+
needs: build
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
environment:
|
|
59
|
+
name: pypi
|
|
60
|
+
url: https://pypi.org/project/yaml-compose/
|
|
61
|
+
permissions:
|
|
62
|
+
id-token: write
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/download-artifact@v4
|
|
65
|
+
with:
|
|
66
|
+
name: python-distributions
|
|
67
|
+
path: dist
|
|
68
|
+
- name: Publish to PyPI
|
|
69
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
.venv/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
yaml-compose-test-*/
|
|
7
|
+
.ruff_cache/
|
|
8
|
+
.rumdl_cache/
|
|
9
|
+
.pre-commit-cache/
|
|
10
|
+
.pip-cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.pyright/
|
|
13
|
+
.coverage
|
|
14
|
+
htmlcov/
|
|
15
|
+
# Keep machine-specific IDE settings local; shared Python tooling lives in pyproject.toml.
|
|
16
|
+
.idea/
|
|
17
|
+
.vscode/
|
|
18
|
+
.DS_Store
|
|
19
|
+
Thumbs.db
|
|
20
|
+
build/
|
|
21
|
+
dist/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: local
|
|
3
|
+
hooks:
|
|
4
|
+
- id: ruff-check
|
|
5
|
+
name: Ruff lint
|
|
6
|
+
entry: python -m ruff check src examples scripts tests
|
|
7
|
+
language: system
|
|
8
|
+
pass_filenames: false
|
|
9
|
+
always_run: true
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
name: Ruff format
|
|
12
|
+
entry: python -m ruff format --check src examples scripts tests
|
|
13
|
+
language: system
|
|
14
|
+
pass_filenames: false
|
|
15
|
+
always_run: true
|
|
16
|
+
- id: rumdl
|
|
17
|
+
name: Markdown lint
|
|
18
|
+
entry: rumdl check .
|
|
19
|
+
language: system
|
|
20
|
+
pass_filenames: false
|
|
21
|
+
always_run: true
|
|
22
|
+
- id: mdrepo
|
|
23
|
+
name: Markdown repository policy
|
|
24
|
+
entry: python -m mdrepo check .
|
|
25
|
+
language: system
|
|
26
|
+
pass_filenames: false
|
|
27
|
+
always_run: true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
Initial release of `yaml-compose`, a PyYAML adapter for composing configuration files.
|
|
6
|
+
|
|
7
|
+
- Safe YAML loading by default, with duplicate explicit mapping keys rejected and
|
|
8
|
+
application-selected PyYAML loaders supported.
|
|
9
|
+
- File includes with nested relative resolution, allowed roots, cycle checks, configurable
|
|
10
|
+
search precedence, and injectable filesystem or in-memory resolvers.
|
|
11
|
+
- Shallow `<<` merges and recursive `<<<` overlays. Local keys win; earlier sources in
|
|
12
|
+
a merge sequence take precedence over later sources.
|
|
13
|
+
- `!delete` removes inherited keys, `!replace` replaces a mapping, and `!spread` inserts
|
|
14
|
+
anchored or included sequence items at their declared position.
|
|
15
|
+
- In-memory mapping overlays and list spreads work without search paths or allowed roots;
|
|
16
|
+
`!include` checks for an allowed root when it is used.
|
|
17
|
+
- Reusable include-limit profiles, configurable library defaults, per-load overrides,
|
|
18
|
+
and `None` for individual unbounded resources. Profiles can be adjusted for later loads;
|
|
19
|
+
each load captures its own limits snapshot. Default budgets allow 32 include levels,
|
|
20
|
+
1,024 reads, 8 MiB per file, and 64 MiB total.
|
|
21
|
+
- Typed public APIs, runnable examples, and tests on Python 3.10–3.15 on Linux and Windows.
|
|
22
|
+
- MIT licensing, credited to `sheepfling`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sheepfling
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include .gitignore
|
|
2
|
+
include .pre-commit-config.yaml
|
|
3
|
+
include quality-gates.toml
|
|
4
|
+
include LICENSE
|
|
5
|
+
include CHANGELOG.md
|
|
6
|
+
recursive-include .github *.yml
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
prune examples
|
|
9
|
+
recursive-include scripts *.py
|
|
10
|
+
recursive-include tests *.py
|