Conversation
Seven command line options had non-None defaults, so value_or_ini never fell through to the ini file. stacks and most_allocations come back from the ini as strings, and fail-on-increase was read under its option dest rather than its ini key. Fixes bloomberg#135 Signed-off-by: mkzung <103102868+mkzung@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #135.
value_or_inionly reads the ini file when the command line value isNone, but seven options defaulted toFalse,5or1, so their ini keys were never read. Those defaults areNonenow, and the ini keys carry the old defaults instead.Two more things broke the same path once it was reached.
stacksandmost_allocationscome back from the ini as strings, so they are converted withint(). Thefail-on-increaseini key has hyphens while the code looked it up under the option's dest,fail_on_increase, so it is read under its ini name. The README listedmost-allocationsas the ini key; the registered one ismost_allocations.Four new tests set
memray,hide_memray_summary,most_allocationsandfail-on-increasein the ini file, and all four fail onmain. The full suite passes, as do ruff, black and mypy.