Skip to content

Conversation

bluetech
Copy link
Member

Fix #13829.

Currently based on #13830 -- please skip that commit.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 19, 2025
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

assert config.getini("old_name") == "value1"
assert config.getini("legacy_name") == "value1"

def test_addini_aliases_with_override(self, pytester: Pytester) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps worth adding a test where the ini file uses the new name, and the cmdline override uses the old name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion -- this case is actually broken. It worked in my version before #13830 but broke after it.

I pushed the broken test now, will work on the fix later.

One option is to revert #13830, but the version before was pretty unruly, I still think #13830 is a good idea.

My thinking is to track the origin of ini values in inicfg (change it from dict[str, str] to dict[str, IniValue] where IniValue contains the value and origin -- configuration file or cli override). Then we give priority to overrides even if they're alias and the canonical is defined. Maybe the origin can be used for better error messages as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented this, pushed as a separate commit (will squash before merging).

@bluetech bluetech marked this pull request as draft October 21, 2025 14:34
@bluetech bluetech marked this pull request as ready for review October 21, 2025 19:38
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ini option aliases

2 participants