{"id":"cbe5c15cb383724a","repo":"python-poetry/poetry","slug":"invalid-config-setting-format-config-setting-c","errorCode":null,"errorMessage":"Invalid config setting format: {config_setting}. Config settings must be in the format 'key=value'","messagePattern":"Invalid config setting format: (.+?)\\. Config settings must be in the format 'key=value'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/poetry/console/commands/build.py","lineNumber":218,"sourceCode":"\n    @staticmethod\n    def _prepare_config_settings(\n        local_version: str | None, config_settings: list[str] | None, io: IO\n    ) -> dict[str, str]:\n        config_settings = config_settings or []\n        result = {}\n\n        if local_version:\n            io.write_error_line(\n                f\"<warning>`<fg=yellow;options=bold>--local-version</>` is deprecated.\"\n                f\" Use `<fg=yellow;options=bold>--config-settings local-version={local_version}</>`\"\n                f\" instead.</warning>\"\n            )\n            result[\"local-version\"] = local_version\n\n        for config_setting in config_settings:\n            if \"=\" not in config_setting:\n                raise ValueError(\n                    f\"Invalid config setting format: {config_setting}. \"\n                    \"Config settings must be in the format 'key=value'\"\n                )\n\n            key, _, value = config_setting.partition(\"=\")\n            result[key] = value\n\n        return result\n\n    @staticmethod\n    def _prepare_formats(fmt: str | None) -> list[str]:\n        fmt = fmt or \"all\"\n\n        return [\"sdist\", \"wheel\"] if fmt == \"all\" else [fmt]\n\n    def handle(self) -> int:\n        build_handler = BuildHandler(\n            poetry=self.poetry,","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/console/commands/build.py#L200-L236","documentation":"Raises ValueError in BuildCommand._prepare_config_settings() when a --config-settings (-c) argument does not contain an '=' character. Config settings must be passed in 'key=value' format so the method can partition on '=' to extract the key and value. The check at line 217 is `if '=' not in config_setting`.","triggerScenarios":"Running `poetry build -c foo` (no '=' sign), or `poetry build --config-settings local-version` without the '=value' portion. Any --config-settings entry missing the delimiter triggers this.","commonSituations":"User forgets the value portion, uses a space instead of '=' (which the shell would also misparse), or passes a flag-style argument by mistake.","solutions":["Rewrite the argument in key=value form, e.g. `poetry build -c local-version=abc123`.","If you need multiple settings, repeat -c for each: `poetry build -c key1=val1 -c key2=val2`."],"exampleFix":"# before (error)\npoetry build -c local-version\n# after\npoetry build -c local-version=abc123","handlingStrategy":"validation","validationCode":"def validate_config_setting(setting: str) -> None:\n    if \"=\" not in setting:\n        raise ValueError(\n            f\"Config setting '{setting}' must be in 'key=value' format\"\n        )","typeGuard":"def is_valid_config_setting(setting: str) -> bool:\n    return \"=\" in setting","tryCatchPattern":null,"preventionTips":["Always pass --config-settings as key=value pairs.","Repeat -c for multiple settings rather than using spaces within one argument.","Quote arguments if values contain spaces."],"tags":["build-command","config-settings","valueerror","cli-validation"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}