Skip to content

Commit 4e1b0df

Browse files
committed
feat(cli): wip: add --config-settings to build command
1 parent 19ab2ef commit 4e1b0df

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/poetry/console/commands/build.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BuildCommand(EnvCommand):
3535
option(
3636
"local-version",
3737
"l",
38-
"Add or replace a local version label to the build.",
38+
"Add or replace a local version label to the build. (<warning>Deprecated</warning>)",
3939
flag=False,
4040
),
4141
option(
@@ -45,6 +45,12 @@ class BuildCommand(EnvCommand):
4545
default="dist",
4646
flag=False,
4747
),
48+
option(
49+
"config-settings",
50+
description="Provide config settings that should be passed to backend in <key>=<value> format.",
51+
flag=False,
52+
multiple=True,
53+
),
4854
]
4955

5056
loggers: ClassVar[list[str]] = [
@@ -69,8 +75,17 @@ def _config_settings(self) -> dict[str, str]:
6975
config_settings = {}
7076

7177
if local_version_label := self.option("local-version"):
78+
self.line_error(
79+
f"<warning>`<fg=yellow;options=bold>--local-version</>` is deprecated."
80+
f" Use `<fg=yellow;options=bold>--config-settings local-version={local_version_label}</>`"
81+
f" instead.</warning>"
82+
)
7283
config_settings["local-version"] = local_version_label
7384

85+
for config_setting in self.option("config-settings"):
86+
key, _, value = config_setting.partition("=")
87+
config_settings[key] = value
88+
7489
return config_settings
7590

7691
def _build(

0 commit comments

Comments
 (0)