replace-workspace-values.py: format
This commit is contained in:
@@ -44,17 +44,17 @@ def replace_key(
|
|||||||
|
|
||||||
final: dict[str, Any] = workspace_dep.copy()
|
final: dict[str, Any] = workspace_dep.copy()
|
||||||
|
|
||||||
merged_features = local_dep.pop("features", []) + workspace_dep.get("features", [])
|
merged_features = local_dep.pop("features", []) + workspace_dep.get(
|
||||||
|
"features", []
|
||||||
|
)
|
||||||
if merged_features:
|
if merged_features:
|
||||||
final["features"] = merged_features
|
final["features"] = merged_features
|
||||||
|
|
||||||
local_default_features = local_dep.pop(
|
local_default_features = local_dep.pop(
|
||||||
"default-features",
|
"default-features", local_dep.pop("default_features", None)
|
||||||
local_dep.pop("default_features", None)
|
|
||||||
)
|
)
|
||||||
workspace_default_features = workspace_dep.get(
|
workspace_default_features = workspace_dep.get(
|
||||||
"default-features",
|
"default-features", workspace_dep.get("default_features")
|
||||||
workspace_dep.get("default_features")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if not workspace_default_features and local_default_features:
|
if not workspace_default_features and local_default_features:
|
||||||
@@ -68,7 +68,9 @@ def replace_key(
|
|||||||
final["package"] = local_dep.pop("package")
|
final["package"] = local_dep.pop("package")
|
||||||
|
|
||||||
if local_dep:
|
if local_dep:
|
||||||
raise Exception(f"Unhandled keys in inherited dependency {key}: {local_dep}")
|
raise Exception(
|
||||||
|
f"Unhandled keys in inherited dependency {key}: {local_dep}"
|
||||||
|
)
|
||||||
|
|
||||||
table[key] = final
|
table[key] = final
|
||||||
elif section == "package":
|
elif section == "package":
|
||||||
|
|||||||
Reference in New Issue
Block a user