Skip to content

Commit bc0fd82

Browse files
committed
add comments
1 parent cbc9c12 commit bc0fd82

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/_pytask/lock.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ def _run_lock_command(
267267
console.print()
268268
console.print(empty_message)
269269

270+
# Journal replay can make the lockfile state dirty even if this lock command
271+
# has no net changes. Flush it so replayed entries are persisted and the
272+
# journal is removed.
273+
if not session.config["dry_run"]:
274+
session.config["lockfile_state"].flush()
275+
270276
console.print()
271277
console.rule(style="default")
272278
except CollectionError:
@@ -280,6 +286,8 @@ def _run_lock_command(
280286
console.rule(style="failed")
281287
session.exit_code = ExitCode.FAILED
282288

289+
# Configuration can fail before the session receives the plugin manager's hook
290+
# relay. A fallback session only has a bare HookRelay without this hook.
283291
if hasattr(session.hook, "pytask_unconfigure"):
284292
session.hook.pytask_unconfigure(session=session)
285293
return session.exit_code

0 commit comments

Comments
 (0)