Repository navigation
refactor: unify registry bootstrap and remove silent exception swallowing - #202
Merged
Merged
Conversation
…wing (fixes #166) - Refactor ensure_registries() to fail loud by default - Add optional_packages parameter for graceful degradation - Add fail_on_error parameter for flexible error handling - Remove duplicated ensure_registries() from play_interactive.py - Add comprehensive tests for new behavior - Scripts now use unified ensure_registries from unilab.training
Jaui7
pushed a commit
that referenced
this pull request
Apr 14, 2026
…ootstrap refactor: unify registry bootstrap and remove silent exception swallowing
TATP-233
added a commit
that referenced
this pull request
May 4, 2026
…ootstrap refactor: unify registry bootstrap and remove silent exception swallowing
TATP-233
added a commit
that referenced
this pull request
May 30, 2026
…ootstrap refactor: unify registry bootstrap and remove silent exception swallowing
TATP-233
added a commit
that referenced
this pull request
Sep 4, 2026
…ootstrap refactor: unify registry bootstrap and remove silent exception swallowing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #166
This PR unifies the registry bootstrap implementation and removes the silent exception swallowing behavior.
Changes
1. Refactored
ensure_registries()insrc/unilab/utils/algo_utils.pyexcept Exception: passto raising exceptions by defaultoptional_packagesparameter: Allows specifying packages that may not be present (failures are logged as warnings)fail_on_errorparameter: Allows non-optional packages to fail gracefully with warnings when set toFalse2. Removed duplicated bootstrap logic
scripts/play_interactive.py: Now importsensure_registriesfromunilab.traininginstead of having its own copy-pasted implementation3. Added comprehensive tests
New test cases in
tests/utils/test_algo_utils.py:test_fail_on_error_default_raises: Verifies default fail-loud behaviortest_fail_on_error_false_logs_warning: Verifies graceful degradation modetest_optional_package_logs_warning: Verifies optional packages log warningstest_mixed_optional_and_required: Verifies mixed usage works correctlytest_empty_packages_list: Verifies empty list is a no-opBackward Compatibility
ensure_registries()without arguments continue to workValidation
make testpasses (373 passed, 5 skipped)Related