mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-27 15:28:30 +01:00
update ruff to v0.0.254 (#9110)
This commit is contained in:
+4
-5
@@ -409,11 +409,10 @@ class Lockfile(FileMixin):
|
||||
if version == LOCKFILE_VERSION.V1:
|
||||
logger.info("Migrating lock file '%s' from v1 to v2", self.relpath)
|
||||
migrate_lock_v1_to_v2(data, self.latest_version_info)
|
||||
else:
|
||||
if not data:
|
||||
data.update(self.latest_version_info)
|
||||
# order is important, meta should always be at the top
|
||||
logger.info("Generating lock file '%s'", self.relpath)
|
||||
elif not data:
|
||||
data.update(self.latest_version_info)
|
||||
# order is important, meta should always be at the top
|
||||
logger.info("Generating lock file '%s'", self.relpath)
|
||||
|
||||
data["stages"] = data.get("stages", {})
|
||||
modified = data["stages"].get(stage.name, {}) != stage_data.get(
|
||||
|
||||
@@ -102,9 +102,8 @@ def _(obj: dict): # noqa: C901
|
||||
if isinstance(v, bool):
|
||||
if v:
|
||||
result += f"--{k} "
|
||||
else:
|
||||
if config.get("bool", "store_true") == "boolean_optional":
|
||||
result += f"--no-{k} "
|
||||
elif config.get("bool", "store_true") == "boolean_optional":
|
||||
result += f"--no-{k} "
|
||||
|
||||
elif isinstance(v, str):
|
||||
result += f"--{k} {escape_str(v)} "
|
||||
|
||||
@@ -218,13 +218,12 @@ def init(
|
||||
provided=overrides,
|
||||
stream=stream,
|
||||
)
|
||||
elif "live" in overrides:
|
||||
# suppress `metrics`/`plots` if live is selected.
|
||||
defaults.pop("metrics", None)
|
||||
defaults.pop("plots", None)
|
||||
else:
|
||||
if "live" in overrides:
|
||||
# suppress `metrics`/`plots` if live is selected.
|
||||
defaults.pop("metrics", None)
|
||||
defaults.pop("plots", None)
|
||||
else:
|
||||
defaults.pop("live", None) # suppress live otherwise
|
||||
defaults.pop("live", None) # suppress live otherwise
|
||||
|
||||
context: Dict[str, str] = {**defaults, **overrides}
|
||||
assert "cmd" in context
|
||||
|
||||
@@ -412,10 +412,9 @@ def move_properties_to_head(result: Dict[str, Dict[str, Dict[str, Any]]]):
|
||||
if rev_result["status"] == ExpStatus.Running.name:
|
||||
head["status"] = ExpStatus.Running.name
|
||||
rev_result["status"] = ExpStatus.Success.name
|
||||
else:
|
||||
if rev_result["checkpoint_tip"] == rev:
|
||||
head = rev_result
|
||||
checkpoint = True
|
||||
elif rev_result["checkpoint_tip"] == rev:
|
||||
head = rev_result
|
||||
checkpoint = True
|
||||
|
||||
|
||||
def show( # noqa: PLR0913
|
||||
|
||||
@@ -154,12 +154,11 @@ def push_refspec(
|
||||
for ref in scm.iter_refs(base=src):
|
||||
refname = ref.split("/")[-1]
|
||||
refspecs.append(f"{ref}:{dest}{refname}")
|
||||
elif dest.endswith("/"):
|
||||
refname = src.split("/")[-1]
|
||||
refspecs.append(f"{src}:{dest}/{refname}")
|
||||
else:
|
||||
if dest.endswith("/"):
|
||||
refname = src.split("/")[-1]
|
||||
refspecs.append(f"{src}:{dest}/{refname}")
|
||||
else:
|
||||
refspecs.append(f"{src}:{dest}")
|
||||
refspecs.append(f"{src}:{dest}")
|
||||
|
||||
try:
|
||||
results = scm.push_refspecs(
|
||||
|
||||
@@ -440,12 +440,9 @@ def _resolve_definitions(
|
||||
result,
|
||||
unpacked,
|
||||
)
|
||||
else:
|
||||
if _matches(targets, config_path, plot_id):
|
||||
adjusted_props = _adjust_sources(fs, plot_props, config_dir)
|
||||
dpath.util.merge(
|
||||
result, {"data": {plot_id: {**adjusted_props, **props}}}
|
||||
)
|
||||
elif _matches(targets, config_path, plot_id):
|
||||
adjusted_props = _adjust_sources(fs, plot_props, config_dir)
|
||||
dpath.util.merge(result, {"data": {plot_id: {**adjusted_props, **props}}})
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user