Skip to content

fix(config): report the setting name for invalid integer values - #11153

Open
qodelicious wants to merge 1 commit into
python-poetry:mainfrom
qodelicious:config-int-settings-invalid-value
Open

qodelicious wants to merge 1 commit into
python-poetry:mainfrom
qodelicious:config-int-settings-invalid-value

Conversation

@qodelicious

Copy link
Copy Markdown

Resolves: #11148

poetry config reported a bare invalid literal for int() with base 10: 'abc' for requests.max-retries, installer.max-workers and solver.min-release-age. The validators for these settings called int() directly and raised ValueError instead of returning False, so they skipped the usual "<value>" is an invalid value for <key> message.

The validators now return False for values that are not integers, so the error names the setting like the other settings do.

  • Added tests for changed code.
  • Updated documentation for changed code.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config: report the setting name for invalid integer values

1 participant