Add .toml files to option "fromfile" support.#23196
Open
benjyw wants to merge 1 commit intopantsbuild:mainfrom
Open
Add .toml files to option "fromfile" support.#23196benjyw wants to merge 1 commit intopantsbuild:mainfrom
benjyw wants to merge 1 commit intopantsbuild:mainfrom
Conversation
benjyw
commented
Mar 24, 2026
|
|
||
| fn try_deserialize<'a, DE: Deserialize<'a>>( | ||
| value: &'a str, | ||
| fn try_deserialize<DE: DeserializeOwned>( |
Contributor
Author
There was a problem hiding this comment.
This change was necessary because toml serde requires it. All our objects own their strings anyway, so this was no loss.
benjyw
commented
Mar 24, 2026
| ignore = "0.4.25" | ||
| indexmap = { version = "2.13.0", features = ["std", "serde"] } | ||
| indicatif = "0.18.4" | ||
| indoc = "2.0.7" |
Contributor
Author
There was a problem hiding this comment.
We were already indirectly depending on indoc, so this does not introduce a new liability.
Contributor
Author
|
A future change will expand this to allow an option of any type to take its value from a specific location inside the .toml file. E.g., |
Contributor
Author
|
Gentle ping on this, thanks! |
tdyas
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a reminder, the "fromfile" feature is where an
option value
@path/to/fileis read from that file.If the file is .json or .yaml, we deserialize its content
to a list or dict, as needed.
This change adds support for .toml.
A top-level TOML entity must be a table (unlike
JSON/YAML which can have a top-level list).
So we only support this for dict-valued options.