Skip to content

Commit 3389b66

Browse files
Bump v0.6.0 (#54)
* chore: draft 0.6.0 changelog and update README with merge() method * Bump 0.5.0 -> 0.6.0
1 parent 6a430a7 commit 3389b66

6 files changed

Lines changed: 66 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,64 @@
11
# Changelog
2+
## 0.6.0
3+
4+
### Features
5+
6+
- Added `merge()` method to `Document` and `Editor` for recursive mapping merging with deep value updates.
7+
- Added `find_index()` for searching list-of-dicts by matching fields, returning the index of the first matching element.
8+
- Added `ensure_in_list()` for appending a value to a list only if it's not already present.
9+
- Added `RoutingError(PatchError)` to the error hierarchy for non-mapping route failures. Operations that attempt to navigate through non-mapping nodes now raise `RoutingError` instead of generic errors.
10+
- Enhanced error messages with human-readable path formatting in `NodeTypeError` messages for clarity.
11+
- Added basedpyright type checking for improved static type verification.
12+
13+
### Fixes
14+
15+
- Fixed naive colon finder that corrupted quoted keys containing colons (#46).
16+
- Replaced unsafe byte indexing with upfront span validation to prevent index-out-of-bounds errors (#45).
17+
- Fixed nested dict flattening in `_create_at` that could lose intermediate keys during upsert operations (#42).
18+
- Added support for upsert operations into empty documents without requiring sentinel workaround (#35).
19+
20+
### Internal
21+
22+
- Centralized patch-error classification and applied stepdown rule for better error type hierarchy management (#47).
23+
24+
### Documentation
25+
26+
- Added `NodeTypeError` and `RoutingError` to README error hierarchy documentation (#49).
27+
28+
### Testing
29+
30+
- Added `test_api_contracts` to verify Editor/Document method coverage and consistency (#52).
31+
- Added tests verifying `NodeTypeError` is catchable as both `PatchError` and `TypeError` (#51).
32+
## 0.6.0
33+
34+
### Features
35+
36+
- Added `merge()` method to `Document` and `Editor` for recursive mapping merging with deep value updates.
37+
- Added `find_index()` for searching list-of-dicts by matching fields, returning the index of the first matching element.
38+
- Added `ensure_in_list()` for appending a value to a list only if it's not already present.
39+
- Added `RoutingError(PatchError)` to the error hierarchy for non-mapping route failures. Operations that attempt to navigate through non-mapping nodes now raise `RoutingError` instead of generic errors.
40+
- Enhanced error messages with human-readable path formatting in `NodeTypeError` messages for clarity.
41+
- Added basedpyright type checking for improved static type verification.
42+
43+
### Fixes
44+
45+
- Fixed naive colon finder that corrupted quoted keys containing colons.
46+
- Replaced unsafe byte indexing with upfront span validation to prevent index-out-of-bounds errors.
47+
- Fixed nested dict flattening in `_create_at` that could lose intermediate keys during upsert operations.
48+
- Added support for upsert operations into empty documents without requiring sentinel workaround.
49+
50+
### Internal
51+
52+
- Centralized patch-error classification and applied stepdown rule for better error type hierarchy management.
53+
54+
### Documentation
55+
56+
- Added `NodeTypeError` and `RoutingError` to README error hierarchy documentation.
57+
58+
### Testing
59+
60+
- Added `test_api_contracts` to verify Editor/Document method coverage and consistency.
61+
- Added tests verifying `NodeTypeError` is catchable as both `PatchError` and `TypeError`.
262

363
## 0.5.0
464

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "yamltrip"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
edition = "2024"
55
license = "MIT"
66

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ doc.remove_from_list("items", values=["a"])
8282
doc.ensure_in_list("items", value="c") # no-op if already present
8383
doc.ensure_in_list("repos", where={"name": "x"}, value={"name": "x", "version": "1.0"})
8484
doc.sync("items", value=["a", "new", "b"]) # minimal diff-and-patch
85+
doc.merge("config", value={"debug": True, "level": 2}) # recursive mapping merge
8586
doc.find_index("repos", where={"id": "x"}) # find in list-of-dicts; returns int | None
8687

8788
doc.query("items") # Feature with location info
@@ -103,6 +104,7 @@ with yamltrip.edit("config.yml") as ed:
103104
ed.upsert("new_key", value="new_value")
104105
ed.remove("old_key")
105106
ed.sync("deps", value={"a": "1.0", "b": "2.0"}) # minimal patching
107+
ed.merge("settings", value={"debug": True, "level": 2}) # recursive merge
106108
print(ed["version"]) # "2.0"
107109
print(ed.get("missing")) # None
108110
print(ed.original["version"]) # original value before edits

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "maturin>=1.0,<2.0" ]
44

55
[project]
66
name = "yamltrip"
7-
version = "0.5.0"
7+
version = "0.6.0"
88
description = "A round-tripping YAML library for Python"
99
readme = "README.md"
1010
authors = [ { name = "Nathan McDougall", email = "nathan.j.mcdougall@gmail.com" } ]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)