File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments