fix(core): purge partially generated assets on build failure#7462
fix(core): purge partially generated assets on build failure#7462Shreyansh1729 wants to merge 3 commits intoOpenBB-finance:developfrom
Conversation
|
Nice, this is a good solution @Shreyansh1729! To be helpful to the end user, I think it would be a good idea to include the traceback with the offending code as a |
|
Done! I've updated the PR to include full traceback logging and user instructions for OPENBB_DEBUG_MODE as suggested. I also updated the Console utility to ensure these critical build errors are always visible. Let me know if there's anything else! |
|
@deeleeramone any updates ? |
|
@Shreyansh1729, this is good thanks. There is an edge case here that we should probably catch in the outer try block as well, KeyboardInterrupt or signal.SIGTERM + signal.SIGINT. Currently, if the process is terminated - either by the user or programmatically - the partially generated modules survive. How do you think we can guard against that? |
Resolves #7379.
Description
Following the reviewer feedback on #7460, this PR addresses the root cause of the
ImportErrorby ensuring that the build process cleans up (purges) any partially generated files if an exception occurs mid-run.Changes
try...exceptblock inPackageBuilder.build.self._clean(modules)on failure to ensure a consistent workspace state.test_package_builder.pyto verify the purge behavior.