Update dependency tomlkit to ~=0.15.1 #16

Open
Renovate wants to merge 1 commit from renovate/tomlkit-0.x into main
Member

This PR contains the following updates:

Package Change Age Confidence
tomlkit ~=0.14.0~=0.15.1 age confidence

Release Notes

python-poetry/tomlkit (tomlkit)

v0.15.1

Compare Source

Changed
  • Speed up membership tests (key in ...) on Container, Table and InlineTable with native __contains__ implementations, avoiding the inherited MutableMapping round-trip through __getitem__ (which resolves the value and builds an exception on every absent key). (#​483)
  • Speed up parsing by making Source index-based: it now tracks an integer position over the input string instead of materializing a list of (index, char) tuples up front, so construction is O(1) and state save/restore no longer copies an iterator. (#​489)
  • Speed up parsing by scanning character runs in bulk: Source.advance_while/advance_until consume a whole run of whitespace, bare-key or number characters in a single pass over the input string instead of one inc() call per character. (#​490)
  • Speed up parsing of single-line strings by bulk-appending the run of ordinary characters up to the next delimiter, backslash or control character in one pass, instead of one character at a time. (#​491)
  • Speed up parsing by removing the internal TOMLChar wrapper: the parser now reads plain str characters from Source and detects end-of-input positionally, avoiding a per-character object construction and method dispatch. (#​492)
  • Speed up parsing by comparing StringType members by identity (is) instead of building a set on every is_basic/is_literal/is_singleline/is_multiline call, avoiding millions of enum hashes while parsing. (#​502)
  • Speed up merging super tables by merging in place instead of deep-copying the growing target on every merge, turning the parse of documents with many subtables under a shared super table (e.g. consecutive [a.b.c] / [a.b.d] headers) from O(n²) into O(n). (#​503)
  • Speed up membership tests (key in ...) on out-of-order tables with a native OutOfOrderTableProxy.__contains__, completing #​483 for the last mapping type that still inherited the slow MutableMapping mixin (which resolves the value and builds an exception on every absent key). (#​515)
  • Speed up parsing documents with many dotted keys or table headers sharing a prefix by validating out-of-order tables incrementally: each new fragment is merged into a cached validation container once, instead of re-merging (and deep-copying) every earlier fragment on each append, turning a super-cubic worst case into linear time (80 shared-prefix dotted keys: ~8 s → ~10 ms). (#​479)
  • Speed up parsing of arrays that close right after a value (e.g. the files = [...] blocks that dominate lock files): the parser no longer attempts to read a value while sitting on the closing ], which previously built an UnexpectedCharError just to discard it — and constructing that exception eagerly computes a line/column by scanning the whole document, making it O(document size) per such array. (#​517)
  • Speed up parsing of multiline strings by bulk-appending the run of ordinary characters — across raw line feeds and tabs — up to the next delimiter, backslash, carriage return or control character, instead of one character at a time. This extends to """/''' bodies the single-line fast path added in #​491; a \r still stops the scan so \r\n stays validated and byte-for-byte preserved. (#​518)
  • Speed up unwrap() (converting a parsed document to a plain dict) by resolving each key directly from the container's key map instead of iterating the inherited MutableMapping view, which rebuilt a SingleKey from the bare string for every key just to re-look-up the value. Out-of-order tables still resolve through their proxy, so their validation is unchanged. (#​521)
  • Speed up rendering (as_string() / dumps()) of inline tables with many keys by precomputing the last-key and last-deleted-element indices in a single pass, instead of rescanning the remaining body on every separator comma — turning an O(n²) render into O(n). (#​525)
  • Raise on malformed array element instead of dropping it, (#​527)
Fixed
  • Fix string() dropping a leading newline of a multiline string on round-trip: a value beginning with a newline is now rendered with an extra leading newline (the one the parser trims after the opening delimiter) so it survives re-parsing.
  • Fix invalid serialization with a duplicated comma when removing a non-edge element from a parsed inline table. (#​486)
  • Fix invalid serialization with a duplicated comma when appending or inserting into a comma-first formatted array. (#​499)
  • Fix ParseError when a sub-table extends the last element of an array of tables after an unrelated table. (#​261)
  • Fix unparseable serialization when adding a key to a dotted-key table inside an inline table. (#​500)
  • Fix a table replaced by a plain value being serialized inside the preceding table's body when other tables follow; the value now moves before the first table like other root-level values. (#​504)
  • Fix assigning a table over a dotted key (e.g. doc["a"] = {...} where a came from a.b = ...): the dotted prefix was duplicated onto the new [a] header, and the header then swallowed any sibling that follows it on round-trip. The replacement now renders as a plain table and, when needed, moves before the inline entries (values and dotted keys) it would otherwise capture. (#​513, #​524)
  • Restore dumps() rendering mapping-like wrappers around a parsed document (e.g. dotty_dict's Dotty) through their delegated as_string, preserving the original table order and layout instead of re-encoding through a plain dict — a 0.15.0 regression. (#​482)
  • Fix uncontrolled recursion when parsing deeply nested documents: crafted input could crash the process with a RecursionError. Values nested more than 100 levels deep and keys with more than 100 dotted fragments now raise ParseError. (#​459)
  • Fix comment() producing invalid TOML for a multiline string by prefixing every line with #, not just the first. (#​449)
  • Fix the separator comma being swallowed by a trailing comment when appending a key to a multiline inline table, leaving the new key without a separator so the result no longer round-trips. (#​512)
  • Fix a KeyAlreadyPresent error when parsing or accessing an out-of-order table whose array-of-tables elements are split across the table's parts. (#​505)
  • Out-of-order value-vs-table and dotted-key-vs-table redefinitions are now rejected at parse time instead of being silently accepted or raising only on access. The parser also detects when a non-dotted key is a prefix of an existing dotted key, matching the stdlib tomllib behaviour. (#​523)
  • Reject tables inserted into inline tables instead of serializing invalid TOML. (#​531)
  • Fix assigning an array of tables over a dotted key (e.g. doc["a"] = aot(...) where a came from a.b = ...): the new [[a]] header kept the dotted key's inline position and swallowed the following dotted sibling on round-trip. The array of tables now renders past the inline entries it would otherwise capture, mirroring the table fix for #​513. (#​542)
  • Fix a new top-level scalar being captured by a table rendered from a dotted key: appending a scalar after a dotted-key entry (e.g. a.b = 1) whose table had gained a [a.c]-style child placed the scalar inside that table's scope, silently re-nesting it on round-trip. Scalars now move before such an entry, like they do before regular tables. (#​543)
  • Fix invalid serialization with a duplicated [table] header when adding a key to an out-of-order table whose concrete header is declared after its sub-tables; the new key now lands in the existing concrete part instead of giving the header-less super part a second header. (#​545)
  • Fix a table's display name (its exact header spelling, including whitespace and quoting) being normalised when the table is assigned onto itself, e.g. doc[k] = doc[k] rewriting [keys .'a'.'c'] to [keys.a.'c']. (#​291)
  • Fix missing newlines when appending a key after a dotted inline table, including when the original document has no trailing newline. (#​533)
  • Preserve trailing whitespace when replacing a super table, including assigning it onto itself. (#​534)
  • Fix str() and repr() of out-of-order table proxies to show their merged values. (#​536)
  • Reject decimal integer literals that exceed Python's integer-string conversion limit instead of coercing them to infinity. (#​538)

v0.15.0

Compare Source

Changed
  • Speed up membership tests (key in ...) on Container, Table and InlineTable with native __contains__ implementations, avoiding the inherited MutableMapping round-trip through __getitem__ (which resolves the value and builds an exception on every absent key). (#​483)
  • Speed up parsing by making Source index-based: it now tracks an integer position over the input string instead of materializing a list of (index, char) tuples up front, so construction is O(1) and state save/restore no longer copies an iterator. (#​489)
  • Speed up parsing by scanning character runs in bulk: Source.advance_while/advance_until consume a whole run of whitespace, bare-key or number characters in a single pass over the input string instead of one inc() call per character. (#​490)
  • Speed up parsing of single-line strings by bulk-appending the run of ordinary characters up to the next delimiter, backslash or control character in one pass, instead of one character at a time. (#​491)
  • Speed up parsing by removing the internal TOMLChar wrapper: the parser now reads plain str characters from Source and detects end-of-input positionally, avoiding a per-character object construction and method dispatch. (#​492)
  • Speed up parsing by comparing StringType members by identity (is) instead of building a set on every is_basic/is_literal/is_singleline/is_multiline call, avoiding millions of enum hashes while parsing. (#​502)
  • Speed up merging super tables by merging in place instead of deep-copying the growing target on every merge, turning the parse of documents with many subtables under a shared super table (e.g. consecutive [a.b.c] / [a.b.d] headers) from O(n²) into O(n). (#​503)
  • Speed up membership tests (key in ...) on out-of-order tables with a native OutOfOrderTableProxy.__contains__, completing #​483 for the last mapping type that still inherited the slow MutableMapping mixin (which resolves the value and builds an exception on every absent key). (#​515)
  • Speed up parsing documents with many dotted keys or table headers sharing a prefix by validating out-of-order tables incrementally: each new fragment is merged into a cached validation container once, instead of re-merging (and deep-copying) every earlier fragment on each append, turning a super-cubic worst case into linear time (80 shared-prefix dotted keys: ~8 s → ~10 ms). (#​479)
  • Speed up parsing of arrays that close right after a value (e.g. the files = [...] blocks that dominate lock files): the parser no longer attempts to read a value while sitting on the closing ], which previously built an UnexpectedCharError just to discard it — and constructing that exception eagerly computes a line/column by scanning the whole document, making it O(document size) per such array. (#​517)
  • Speed up parsing of multiline strings by bulk-appending the run of ordinary characters — across raw line feeds and tabs — up to the next delimiter, backslash, carriage return or control character, instead of one character at a time. This extends to """/''' bodies the single-line fast path added in #​491; a \r still stops the scan so \r\n stays validated and byte-for-byte preserved. (#​518)
  • Speed up unwrap() (converting a parsed document to a plain dict) by resolving each key directly from the container's key map instead of iterating the inherited MutableMapping view, which rebuilt a SingleKey from the bare string for every key just to re-look-up the value. Out-of-order tables still resolve through their proxy, so their validation is unchanged. (#​521)
  • Speed up rendering (as_string() / dumps()) of inline tables with many keys by precomputing the last-key and last-deleted-element indices in a single pass, instead of rescanning the remaining body on every separator comma — turning an O(n²) render into O(n). (#​525)
  • Raise on malformed array element instead of dropping it, (#​527)
Fixed
  • Fix string() dropping a leading newline of a multiline string on round-trip: a value beginning with a newline is now rendered with an extra leading newline (the one the parser trims after the opening delimiter) so it survives re-parsing.
  • Fix invalid serialization with a duplicated comma when removing a non-edge element from a parsed inline table. (#​486)
  • Fix invalid serialization with a duplicated comma when appending or inserting into a comma-first formatted array. (#​499)
  • Fix ParseError when a sub-table extends the last element of an array of tables after an unrelated table. (#​261)
  • Fix unparseable serialization when adding a key to a dotted-key table inside an inline table. (#​500)
  • Fix a table replaced by a plain value being serialized inside the preceding table's body when other tables follow; the value now moves before the first table like other root-level values. (#​504)
  • Fix assigning a table over a dotted key (e.g. doc["a"] = {...} where a came from a.b = ...): the dotted prefix was duplicated onto the new [a] header, and the header then swallowed any sibling that follows it on round-trip. The replacement now renders as a plain table and, when needed, moves before the inline entries (values and dotted keys) it would otherwise capture. (#​513, #​524)
  • Restore dumps() rendering mapping-like wrappers around a parsed document (e.g. dotty_dict's Dotty) through their delegated as_string, preserving the original table order and layout instead of re-encoding through a plain dict — a 0.15.0 regression. (#​482)
  • Fix uncontrolled recursion when parsing deeply nested documents: crafted input could crash the process with a RecursionError. Values nested more than 100 levels deep and keys with more than 100 dotted fragments now raise ParseError. (#​459)
  • Fix comment() producing invalid TOML for a multiline string by prefixing every line with #, not just the first. (#​449)
  • Fix the separator comma being swallowed by a trailing comment when appending a key to a multiline inline table, leaving the new key without a separator so the result no longer round-trips. (#​512)
  • Fix a KeyAlreadyPresent error when parsing or accessing an out-of-order table whose array-of-tables elements are split across the table's parts. (#​505)
  • Out-of-order value-vs-table and dotted-key-vs-table redefinitions are now rejected at parse time instead of being silently accepted or raising only on access. The parser also detects when a non-dotted key is a prefix of an existing dotted key, matching the stdlib tomllib behaviour. (#​523)
  • Reject tables inserted into inline tables instead of serializing invalid TOML. (#​531)
  • Fix assigning an array of tables over a dotted key (e.g. doc["a"] = aot(...) where a came from a.b = ...): the new [[a]] header kept the dotted key's inline position and swallowed the following dotted sibling on round-trip. The array of tables now renders past the inline entries it would otherwise capture, mirroring the table fix for #​513. (#​542)
  • Fix a new top-level scalar being captured by a table rendered from a dotted key: appending a scalar after a dotted-key entry (e.g. a.b = 1) whose table had gained a [a.c]-style child placed the scalar inside that table's scope, silently re-nesting it on round-trip. Scalars now move before such an entry, like they do before regular tables. (#​543)
  • Fix invalid serialization with a duplicated [table] header when adding a key to an out-of-order table whose concrete header is declared after its sub-tables; the new key now lands in the existing concrete part instead of giving the header-less super part a second header. (#​545)
  • Fix a table's display name (its exact header spelling, including whitespace and quoting) being normalised when the table is assigned onto itself, e.g. doc[k] = doc[k] rewriting [keys .'a'.'c'] to [keys.a.'c']. (#​291)
  • Fix missing newlines when appending a key after a dotted inline table, including when the original document has no trailing newline. (#​533)
  • Preserve trailing whitespace when replacing a super table, including assigning it onto itself. (#​534)
  • Fix str() and repr() of out-of-order table proxies to show their merged values. (#​536)
  • Reject decimal integer literals that exceed Python's integer-string conversion limit instead of coercing them to infinity. (#​538)

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [tomlkit](https://github.com/python-poetry/tomlkit) | `~=0.14.0` → `~=0.15.1` | ![age](https://developer.mend.io/api/mc/badges/age/pypi/tomlkit/0.15.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/tomlkit/0.14.0/0.15.1?slim=true) | --- ### Release Notes <details> <summary>python-poetry/tomlkit (tomlkit)</summary> ### [`v0.15.1`](https://github.com/python-poetry/tomlkit/blob/HEAD/CHANGELOG.md#0151---2026-07-17) [Compare Source](https://github.com/python-poetry/tomlkit/compare/0.15.0...0.15.1) ##### Changed - Speed up membership tests (`key in ...`) on `Container`, `Table` and `InlineTable` with native `__contains__` implementations, avoiding the inherited `MutableMapping` round-trip through `__getitem__` (which resolves the value and builds an exception on every absent key). ([#&#8203;483](https://github.com/python-poetry/tomlkit/issues/483)) - Speed up parsing by making `Source` index-based: it now tracks an integer position over the input string instead of materializing a list of `(index, char)` tuples up front, so construction is O(1) and state save/restore no longer copies an iterator. ([#&#8203;489](https://github.com/python-poetry/tomlkit/pull/489)) - Speed up parsing by scanning character runs in bulk: `Source.advance_while`/`advance_until` consume a whole run of whitespace, bare-key or number characters in a single pass over the input string instead of one `inc()` call per character. ([#&#8203;490](https://github.com/python-poetry/tomlkit/pull/490)) - Speed up parsing of single-line strings by bulk-appending the run of ordinary characters up to the next delimiter, backslash or control character in one pass, instead of one character at a time. ([#&#8203;491](https://github.com/python-poetry/tomlkit/pull/491)) - Speed up parsing by removing the internal `TOMLChar` wrapper: the parser now reads plain `str` characters from `Source` and detects end-of-input positionally, avoiding a per-character object construction and method dispatch. ([#&#8203;492](https://github.com/python-poetry/tomlkit/pull/492)) - Speed up parsing by comparing `StringType` members by identity (`is`) instead of building a set on every `is_basic`/`is_literal`/`is_singleline`/`is_multiline` call, avoiding millions of enum hashes while parsing. ([#&#8203;502](https://github.com/python-poetry/tomlkit/pull/502)) - Speed up merging super tables by merging in place instead of deep-copying the growing target on every merge, turning the parse of documents with many subtables under a shared super table (e.g. consecutive `[a.b.c]` / `[a.b.d]` headers) from O(n²) into O(n). ([#&#8203;503](https://github.com/python-poetry/tomlkit/pull/503)) - Speed up membership tests (`key in ...`) on out-of-order tables with a native `OutOfOrderTableProxy.__contains__`, completing [#&#8203;483](https://github.com/python-poetry/tomlkit/issues/483) for the last mapping type that still inherited the slow `MutableMapping` mixin (which resolves the value and builds an exception on every absent key). ([#&#8203;515](https://github.com/python-poetry/tomlkit/pull/515)) - Speed up parsing documents with many dotted keys or table headers sharing a prefix by validating out-of-order tables incrementally: each new fragment is merged into a cached validation container once, instead of re-merging (and deep-copying) every earlier fragment on each append, turning a super-cubic worst case into linear time (80 shared-prefix dotted keys: \~8 s → \~10 ms). ([#&#8203;479](https://github.com/python-poetry/tomlkit/issues/479)) - Speed up parsing of arrays that close right after a value (e.g. the `files = [...]` blocks that dominate lock files): the parser no longer attempts to read a value while sitting on the closing `]`, which previously built an `UnexpectedCharError` just to discard it — and constructing that exception eagerly computes a line/column by scanning the whole document, making it O(document size) per such array. ([#&#8203;517](https://github.com/python-poetry/tomlkit/pull/517)) - Speed up parsing of multiline strings by bulk-appending the run of ordinary characters — across raw line feeds and tabs — up to the next delimiter, backslash, carriage return or control character, instead of one character at a time. This extends to `"""`/`'''` bodies the single-line fast path added in [#&#8203;491](https://github.com/python-poetry/tomlkit/pull/491); a `\r` still stops the scan so `\r\n` stays validated and byte-for-byte preserved. ([#&#8203;518](https://github.com/python-poetry/tomlkit/pull/518)) - Speed up `unwrap()` (converting a parsed document to a plain `dict`) by resolving each key directly from the container's key map instead of iterating the inherited `MutableMapping` view, which rebuilt a `SingleKey` from the bare string for every key just to re-look-up the value. Out-of-order tables still resolve through their proxy, so their validation is unchanged. ([#&#8203;521](https://github.com/python-poetry/tomlkit/pull/521)) - Speed up rendering (`as_string()` / `dumps()`) of inline tables with many keys by precomputing the last-key and last-deleted-element indices in a single pass, instead of rescanning the remaining body on every separator comma — turning an O(n²) render into O(n). ([#&#8203;525](https://github.com/python-poetry/tomlkit/pull/525)) - Raise on malformed array element instead of dropping it, ([#&#8203;527](https://github.com/python-poetry/tomlkit/pull/527)) ##### Fixed - Fix `string()` dropping a leading newline of a multiline string on round-trip: a value beginning with a newline is now rendered with an extra leading newline (the one the parser trims after the opening delimiter) so it survives re-parsing. - Fix invalid serialization with a duplicated comma when removing a non-edge element from a parsed inline table. ([#&#8203;486](https://github.com/python-poetry/tomlkit/pull/486)) - Fix invalid serialization with a duplicated comma when appending or inserting into a comma-first formatted array. ([#&#8203;499](https://github.com/python-poetry/tomlkit/pull/499)) - Fix `ParseError` when a sub-table extends the last element of an array of tables after an unrelated table. ([#&#8203;261](https://github.com/python-poetry/tomlkit/issues/261)) - Fix unparseable serialization when adding a key to a dotted-key table inside an inline table. ([#&#8203;500](https://github.com/python-poetry/tomlkit/pull/500)) - Fix a table replaced by a plain value being serialized inside the preceding table's body when other tables follow; the value now moves before the first table like other root-level values. ([#&#8203;504](https://github.com/python-poetry/tomlkit/issues/504)) - Fix assigning a table over a dotted key (e.g. `doc["a"] = {...}` where `a` came from `a.b = ...`): the dotted prefix was duplicated onto the new `[a]` header, and the header then swallowed any sibling that follows it on round-trip. The replacement now renders as a plain table and, when needed, moves before the inline entries (values and dotted keys) it would otherwise capture. ([#&#8203;513](https://github.com/python-poetry/tomlkit/issues/513), [#&#8203;524](https://github.com/python-poetry/tomlkit/issues/524)) - Restore `dumps()` rendering mapping-like wrappers around a parsed document (e.g. `dotty_dict`'s `Dotty`) through their delegated `as_string`, preserving the original table order and layout instead of re-encoding through a plain dict — a 0.15.0 regression. ([#&#8203;482](https://github.com/python-poetry/tomlkit/issues/482)) - Fix uncontrolled recursion when parsing deeply nested documents: crafted input could crash the process with a `RecursionError`. Values nested more than 100 levels deep and keys with more than 100 dotted fragments now raise `ParseError`. ([#&#8203;459](https://github.com/python-poetry/tomlkit/issues/459)) - Fix `comment()` producing invalid TOML for a multiline string by prefixing every line with `#`, not just the first. ([#&#8203;449](https://github.com/python-poetry/tomlkit/issues/449)) - Fix the separator comma being swallowed by a trailing comment when appending a key to a multiline inline table, leaving the new key without a separator so the result no longer round-trips. ([#&#8203;512](https://github.com/python-poetry/tomlkit/issues/512)) - Fix a `KeyAlreadyPresent` error when parsing or accessing an out-of-order table whose array-of-tables elements are split across the table's parts. ([#&#8203;505](https://github.com/python-poetry/tomlkit/issues/505)) - Out-of-order value-vs-table and dotted-key-vs-table redefinitions are now rejected at parse time instead of being silently accepted or raising only on access. The parser also detects when a non-dotted key is a prefix of an existing dotted key, matching the stdlib `tomllib` behaviour. ([#&#8203;523](https://github.com/python-poetry/tomlkit/issues/523)) - Reject tables inserted into inline tables instead of serializing invalid TOML. ([#&#8203;531](https://github.com/python-poetry/tomlkit/issues/531)) - Fix assigning an array of tables over a dotted key (e.g. `doc["a"] = aot(...)` where `a` came from `a.b = ...`): the new `[[a]]` header kept the dotted key's inline position and swallowed the following dotted sibling on round-trip. The array of tables now renders past the inline entries it would otherwise capture, mirroring the table fix for [#&#8203;513](https://github.com/python-poetry/tomlkit/issues/513). ([#&#8203;542](https://github.com/python-poetry/tomlkit/issues/542)) - Fix a new top-level scalar being captured by a table rendered from a dotted key: appending a scalar after a dotted-key entry (e.g. `a.b = 1`) whose table had gained a `[a.c]`-style child placed the scalar inside that table's scope, silently re-nesting it on round-trip. Scalars now move before such an entry, like they do before regular tables. ([#&#8203;543](https://github.com/python-poetry/tomlkit/issues/543)) - Fix invalid serialization with a duplicated `[table]` header when adding a key to an out-of-order table whose concrete header is declared after its sub-tables; the new key now lands in the existing concrete part instead of giving the header-less super part a second header. ([#&#8203;545](https://github.com/python-poetry/tomlkit/pull/545)) - Fix a table's display name (its exact header spelling, including whitespace and quoting) being normalised when the table is assigned onto itself, e.g. `doc[k] = doc[k]` rewriting `[keys .'a'.'c']` to `[keys.a.'c']`. ([#&#8203;291](https://github.com/python-poetry/tomlkit/issues/291)) - Fix missing newlines when appending a key after a dotted inline table, including when the original document has no trailing newline. ([#&#8203;533](https://github.com/python-poetry/tomlkit/pull/533)) - Preserve trailing whitespace when replacing a super table, including assigning it onto itself. ([#&#8203;534](https://github.com/python-poetry/tomlkit/pull/534)) - Fix `str()` and `repr()` of out-of-order table proxies to show their merged values. ([#&#8203;536](https://github.com/python-poetry/tomlkit/pull/536)) - Reject decimal integer literals that exceed Python's integer-string conversion limit instead of coercing them to infinity. ([#&#8203;538](https://github.com/python-poetry/tomlkit/pull/538)) ### [`v0.15.0`](https://github.com/python-poetry/tomlkit/blob/HEAD/CHANGELOG.md#0151---2026-07-17) [Compare Source](https://github.com/python-poetry/tomlkit/compare/0.14.0...0.15.0) ##### Changed - Speed up membership tests (`key in ...`) on `Container`, `Table` and `InlineTable` with native `__contains__` implementations, avoiding the inherited `MutableMapping` round-trip through `__getitem__` (which resolves the value and builds an exception on every absent key). ([#&#8203;483](https://github.com/python-poetry/tomlkit/issues/483)) - Speed up parsing by making `Source` index-based: it now tracks an integer position over the input string instead of materializing a list of `(index, char)` tuples up front, so construction is O(1) and state save/restore no longer copies an iterator. ([#&#8203;489](https://github.com/python-poetry/tomlkit/pull/489)) - Speed up parsing by scanning character runs in bulk: `Source.advance_while`/`advance_until` consume a whole run of whitespace, bare-key or number characters in a single pass over the input string instead of one `inc()` call per character. ([#&#8203;490](https://github.com/python-poetry/tomlkit/pull/490)) - Speed up parsing of single-line strings by bulk-appending the run of ordinary characters up to the next delimiter, backslash or control character in one pass, instead of one character at a time. ([#&#8203;491](https://github.com/python-poetry/tomlkit/pull/491)) - Speed up parsing by removing the internal `TOMLChar` wrapper: the parser now reads plain `str` characters from `Source` and detects end-of-input positionally, avoiding a per-character object construction and method dispatch. ([#&#8203;492](https://github.com/python-poetry/tomlkit/pull/492)) - Speed up parsing by comparing `StringType` members by identity (`is`) instead of building a set on every `is_basic`/`is_literal`/`is_singleline`/`is_multiline` call, avoiding millions of enum hashes while parsing. ([#&#8203;502](https://github.com/python-poetry/tomlkit/pull/502)) - Speed up merging super tables by merging in place instead of deep-copying the growing target on every merge, turning the parse of documents with many subtables under a shared super table (e.g. consecutive `[a.b.c]` / `[a.b.d]` headers) from O(n²) into O(n). ([#&#8203;503](https://github.com/python-poetry/tomlkit/pull/503)) - Speed up membership tests (`key in ...`) on out-of-order tables with a native `OutOfOrderTableProxy.__contains__`, completing [#&#8203;483](https://github.com/python-poetry/tomlkit/issues/483) for the last mapping type that still inherited the slow `MutableMapping` mixin (which resolves the value and builds an exception on every absent key). ([#&#8203;515](https://github.com/python-poetry/tomlkit/pull/515)) - Speed up parsing documents with many dotted keys or table headers sharing a prefix by validating out-of-order tables incrementally: each new fragment is merged into a cached validation container once, instead of re-merging (and deep-copying) every earlier fragment on each append, turning a super-cubic worst case into linear time (80 shared-prefix dotted keys: \~8 s → \~10 ms). ([#&#8203;479](https://github.com/python-poetry/tomlkit/issues/479)) - Speed up parsing of arrays that close right after a value (e.g. the `files = [...]` blocks that dominate lock files): the parser no longer attempts to read a value while sitting on the closing `]`, which previously built an `UnexpectedCharError` just to discard it — and constructing that exception eagerly computes a line/column by scanning the whole document, making it O(document size) per such array. ([#&#8203;517](https://github.com/python-poetry/tomlkit/pull/517)) - Speed up parsing of multiline strings by bulk-appending the run of ordinary characters — across raw line feeds and tabs — up to the next delimiter, backslash, carriage return or control character, instead of one character at a time. This extends to `"""`/`'''` bodies the single-line fast path added in [#&#8203;491](https://github.com/python-poetry/tomlkit/pull/491); a `\r` still stops the scan so `\r\n` stays validated and byte-for-byte preserved. ([#&#8203;518](https://github.com/python-poetry/tomlkit/pull/518)) - Speed up `unwrap()` (converting a parsed document to a plain `dict`) by resolving each key directly from the container's key map instead of iterating the inherited `MutableMapping` view, which rebuilt a `SingleKey` from the bare string for every key just to re-look-up the value. Out-of-order tables still resolve through their proxy, so their validation is unchanged. ([#&#8203;521](https://github.com/python-poetry/tomlkit/pull/521)) - Speed up rendering (`as_string()` / `dumps()`) of inline tables with many keys by precomputing the last-key and last-deleted-element indices in a single pass, instead of rescanning the remaining body on every separator comma — turning an O(n²) render into O(n). ([#&#8203;525](https://github.com/python-poetry/tomlkit/pull/525)) - Raise on malformed array element instead of dropping it, ([#&#8203;527](https://github.com/python-poetry/tomlkit/pull/527)) ##### Fixed - Fix `string()` dropping a leading newline of a multiline string on round-trip: a value beginning with a newline is now rendered with an extra leading newline (the one the parser trims after the opening delimiter) so it survives re-parsing. - Fix invalid serialization with a duplicated comma when removing a non-edge element from a parsed inline table. ([#&#8203;486](https://github.com/python-poetry/tomlkit/pull/486)) - Fix invalid serialization with a duplicated comma when appending or inserting into a comma-first formatted array. ([#&#8203;499](https://github.com/python-poetry/tomlkit/pull/499)) - Fix `ParseError` when a sub-table extends the last element of an array of tables after an unrelated table. ([#&#8203;261](https://github.com/python-poetry/tomlkit/issues/261)) - Fix unparseable serialization when adding a key to a dotted-key table inside an inline table. ([#&#8203;500](https://github.com/python-poetry/tomlkit/pull/500)) - Fix a table replaced by a plain value being serialized inside the preceding table's body when other tables follow; the value now moves before the first table like other root-level values. ([#&#8203;504](https://github.com/python-poetry/tomlkit/issues/504)) - Fix assigning a table over a dotted key (e.g. `doc["a"] = {...}` where `a` came from `a.b = ...`): the dotted prefix was duplicated onto the new `[a]` header, and the header then swallowed any sibling that follows it on round-trip. The replacement now renders as a plain table and, when needed, moves before the inline entries (values and dotted keys) it would otherwise capture. ([#&#8203;513](https://github.com/python-poetry/tomlkit/issues/513), [#&#8203;524](https://github.com/python-poetry/tomlkit/issues/524)) - Restore `dumps()` rendering mapping-like wrappers around a parsed document (e.g. `dotty_dict`'s `Dotty`) through their delegated `as_string`, preserving the original table order and layout instead of re-encoding through a plain dict — a 0.15.0 regression. ([#&#8203;482](https://github.com/python-poetry/tomlkit/issues/482)) - Fix uncontrolled recursion when parsing deeply nested documents: crafted input could crash the process with a `RecursionError`. Values nested more than 100 levels deep and keys with more than 100 dotted fragments now raise `ParseError`. ([#&#8203;459](https://github.com/python-poetry/tomlkit/issues/459)) - Fix `comment()` producing invalid TOML for a multiline string by prefixing every line with `#`, not just the first. ([#&#8203;449](https://github.com/python-poetry/tomlkit/issues/449)) - Fix the separator comma being swallowed by a trailing comment when appending a key to a multiline inline table, leaving the new key without a separator so the result no longer round-trips. ([#&#8203;512](https://github.com/python-poetry/tomlkit/issues/512)) - Fix a `KeyAlreadyPresent` error when parsing or accessing an out-of-order table whose array-of-tables elements are split across the table's parts. ([#&#8203;505](https://github.com/python-poetry/tomlkit/issues/505)) - Out-of-order value-vs-table and dotted-key-vs-table redefinitions are now rejected at parse time instead of being silently accepted or raising only on access. The parser also detects when a non-dotted key is a prefix of an existing dotted key, matching the stdlib `tomllib` behaviour. ([#&#8203;523](https://github.com/python-poetry/tomlkit/issues/523)) - Reject tables inserted into inline tables instead of serializing invalid TOML. ([#&#8203;531](https://github.com/python-poetry/tomlkit/issues/531)) - Fix assigning an array of tables over a dotted key (e.g. `doc["a"] = aot(...)` where `a` came from `a.b = ...`): the new `[[a]]` header kept the dotted key's inline position and swallowed the following dotted sibling on round-trip. The array of tables now renders past the inline entries it would otherwise capture, mirroring the table fix for [#&#8203;513](https://github.com/python-poetry/tomlkit/issues/513). ([#&#8203;542](https://github.com/python-poetry/tomlkit/issues/542)) - Fix a new top-level scalar being captured by a table rendered from a dotted key: appending a scalar after a dotted-key entry (e.g. `a.b = 1`) whose table had gained a `[a.c]`-style child placed the scalar inside that table's scope, silently re-nesting it on round-trip. Scalars now move before such an entry, like they do before regular tables. ([#&#8203;543](https://github.com/python-poetry/tomlkit/issues/543)) - Fix invalid serialization with a duplicated `[table]` header when adding a key to an out-of-order table whose concrete header is declared after its sub-tables; the new key now lands in the existing concrete part instead of giving the header-less super part a second header. ([#&#8203;545](https://github.com/python-poetry/tomlkit/pull/545)) - Fix a table's display name (its exact header spelling, including whitespace and quoting) being normalised when the table is assigned onto itself, e.g. `doc[k] = doc[k]` rewriting `[keys .'a'.'c']` to `[keys.a.'c']`. ([#&#8203;291](https://github.com/python-poetry/tomlkit/issues/291)) - Fix missing newlines when appending a key after a dotted inline table, including when the original document has no trailing newline. ([#&#8203;533](https://github.com/python-poetry/tomlkit/pull/533)) - Preserve trailing whitespace when replacing a super table, including assigning it onto itself. ([#&#8203;534](https://github.com/python-poetry/tomlkit/pull/534)) - Fix `str()` and `repr()` of out-of-order table proxies to show their merged values. ([#&#8203;536](https://github.com/python-poetry/tomlkit/pull/536)) - Reject decimal integer literals that exceed Python's integer-string conversion limit instead of coercing them to infinity. ([#&#8203;538](https://github.com/python-poetry/tomlkit/pull/538)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjUyLjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
Update dependency tomlkit to ~=0.15.0
All checks were successful
Actions / Build (pull_request) Successful in 32s
Actions / Lint (pull_request) Successful in 37s
67d1add34b
Renovate force-pushed renovate/tomlkit-0.x from 67d1add34b
All checks were successful
Actions / Build (pull_request) Successful in 32s
Actions / Lint (pull_request) Successful in 37s
to cb6adf541c
All checks were successful
Actions / Build (pull_request) Successful in 31s
Actions / Lint (pull_request) Successful in 38s
2026-07-16 22:04:35 -04:00
Compare
Renovate changed title from Update dependency tomlkit to ~=0.15.0 to Update dependency tomlkit to ~=0.15.1 2026-07-16 22:04:35 -04:00
All checks were successful
Actions / Build (pull_request) Successful in 31s
Required
Details
Actions / Lint (pull_request) Successful in 38s
Required
Details
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/tomlkit-0.x:renovate/tomlkit-0.x
git switch renovate/tomlkit-0.x
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GalacticFactory/GalacticFactoryUtils!16
No description provided.