Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

The build script failed when processing notebooks due to incorrect path handling. Path.rglob() returns relative paths, but the code unconditionally called .relative_to(Path.cwd()) on them, causing a ValueError.

Changes:

  • Added path type check before conversion: only call .relative_to() on absolute paths
  • Relative paths are now used as-is
# Before
rel = nb.relative_to(Path.cwd())  # Fails on relative paths

# After  
if nb.is_absolute():
    rel = nb.relative_to(Path.cwd())
else:
    rel = nb  # Already relative

This allows the script to execute all notebooks through to completion, with graceful error handling for notebooks with missing dependencies.

Original prompt

Make sure these errors are fixed and they can go all the way through to the very end


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: solveforceapp <98552991+solveforceapp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix errors to ensure complete processing Fix ValueError in build_notebooks.py for relative path handling Nov 21, 2025
Copilot AI requested a review from solveforceapp November 21, 2025 01:48
@solveforceapp solveforceapp marked this pull request as ready for review November 24, 2025 16:29
@solveforceapp solveforceapp merged commit 3e54003 into main Nov 24, 2025
4 checks passed
@solveforceapp solveforceapp deleted the copilot/fix-errors-throughout-process branch November 24, 2025 16:35
Copy link
Owner

@solveforceapp solveforceapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants