Skip to content

Commit 7ac84e1

Browse files
committed
feat(cli): wip: add --config-settings to build command
1 parent 4649449 commit 7ac84e1

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]] = [
@@ -70,8 +76,17 @@ def _config_settings(self) -> dict[str, str]:
7076
config_settings = {}
7177

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

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

7792
def _build(

0 commit comments

Comments
 (0)