nbdevAuto 0.3.75__tar.gz → 0.3.76__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdevAuto
3
- Version: 0.3.75
3
+ Version: 0.3.76
4
4
  Summary: automating nbdev
5
5
  Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -0,0 +1 @@
1
+ __version__ = "0.3.76"
@@ -354,13 +354,20 @@ def init_new(root=None, dry_run=False):
354
354
  return new
355
355
 
356
356
  def pull_root(base):
357
- "Fast-forward the superproject itself, with the advice its usual failure needs"
357
+ "Fast-forward the superproject itself, with the advice its failure actually needs"
358
358
  try: return _run("git", "-C", str(base), "pull", "--ff-only").strip().splitlines()[-1:]
359
359
  except StepFailed as e:
360
- raise StepFailed(e.cmd, e.code, f"{e.output}\n"
361
- "If it complains about submodule paths, the recorded gitlinks drifted.\n"
362
- "Discard them (the update step re-advances them anyway):\n"
363
- " git checkout -- $(git diff --name-only)") from None
360
+ # Two failures, two fixes. Discarding gitlinks does nothing for a diverged branch,
361
+ # and a rebase does nothing for drifted gitlinks.
362
+ if "Not possible to fast-forward" in e.output:
363
+ hint = ("Local main and origin/main both have new commits.\n"
364
+ "Replay yours on top of the remote, then re-run:\n"
365
+ " git pull --rebase && just sync")
366
+ else:
367
+ hint = ("If it complains about submodule paths, the recorded gitlinks drifted.\n"
368
+ "Discard them (the update step re-advances them anyway):\n"
369
+ " git checkout -- $(git diff --name-only)")
370
+ raise StepFailed(e.cmd, e.code, f"{e.output}\n{hint}") from None
364
371
 
365
372
  # %% ../nbs/04_Fleet.ipynb #8fb7bc91-d79a-4c1a-bb81-e28b3a77b118
366
373
  def fleet_update(
@@ -608,7 +615,12 @@ def fleet():
608
615
  if not picked:
609
616
  print(usage())
610
617
  sys.exit(0 if sys.argv[1:2] in ([], ["-h"], ["--help"]) else 2)
611
- return run_verb(*picked)
618
+ # `_step` has already printed the failing command's output, so a traceback on top of
619
+ # it only buries the hint. One line and the exit code are all that is left to say.
620
+ try: return run_verb(*picked)
621
+ except StepFailed as e:
622
+ console.print(f"[bold red]FAILED[/bold red] [dim]{escape(str(e))}[/dim]")
623
+ sys.exit(1)
612
624
 
613
625
  # %% ../nbs/04_Fleet.ipynb #7adb89c6-6788-4241-acff-53cb4566b5ce
614
626
  if __name__ == "__main__": fleet()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdevAuto
3
- Version: 0.3.75
3
+ Version: 0.3.76
4
4
  Summary: automating nbdev
5
5
  Author-email: Benedict Thekkel <bthekkel1@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -1 +0,0 @@
1
- __version__ = "0.3.75"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes