File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
src/poetry/console/commands Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class BuildCommand(EnvCommand):
36
36
option (
37
37
"local-version" ,
38
38
"l" ,
39
- "Add or replace a local version label to the build." ,
39
+ "Add or replace a local version label to the build. (<warning>Deprecated</warning>) " ,
40
40
flag = False ,
41
41
),
42
42
option (
@@ -46,6 +46,12 @@ class BuildCommand(EnvCommand):
46
46
default = "dist" ,
47
47
flag = False ,
48
48
),
49
+ option (
50
+ "config-settings" ,
51
+ description = "Provide config settings that should be passed to backend in <key>=<value> format." ,
52
+ flag = False ,
53
+ multiple = True ,
54
+ ),
49
55
]
50
56
51
57
loggers : ClassVar [list [str ]] = [
@@ -71,8 +77,23 @@ def _config_settings(self) -> dict[str, str]:
71
77
config_settings = {}
72
78
73
79
if local_version_label := self .option ("local-version" ):
80
+ self .line_error (
81
+ f"<warning>`<fg=yellow;options=bold>--local-version</>` is deprecated."
82
+ f" Use `<fg=yellow;options=bold>--config-settings local-version={ local_version_label } </>`"
83
+ f" instead.</warning>"
84
+ )
74
85
config_settings ["local-version" ] = local_version_label
75
86
87
+ for config_setting in self .option ("config-settings" ):
88
+ if "=" not in config_setting :
89
+ raise ValueError (
90
+ f"Invalid config setting format: { config_setting } . "
91
+ "Config settings must be in the format 'key=value'"
92
+ )
93
+
94
+ key , _ , value = config_setting .partition ("=" )
95
+ config_settings [key ] = value
96
+
76
97
return config_settings
77
98
78
99
def _build (
You can’t perform that action at this time.
0 commit comments