Add graceful fallback for loguru, export version, and log zamba version at runtime#401
Open
intagliated wants to merge 2 commits into
Open
Add graceful fallback for loguru, export version, and log zamba version at runtime#401intagliated wants to merge 2 commits into
intagliated wants to merge 2 commits into
Conversation
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.
Changes
zamba/__init__.pyloguruimport with atry/except, falling back to the standardloggingmodule. Configured the logger for both paths, exported__version__, and added documentation comments.zamba/images/manager.pylogger.info(f"Running zamba version {__version__}")at the start of thepredictandtrainfunctions.zamba/models/model_manager.pytrain_modelandpredict_model.pyproject.toml"loguru"to thetestsoptional‑dependency list and updated formatting to keep the file PEP‑518‑compliant.loguru/__init__.py(temporary stub)loggercompatible with the tiny subset of theloguruAPI used in the project. This file can be removed after the reallogurupackage is installed via the new test dependency.How to Verify
Install the package with test dependencies
The
testsoptional‑dependency group now includesloguru, so the real library will be installed automatically.Run the test suite
Expected outcome: All tests pass without raising
ModuleNotFoundError: No module named 'loguru'.Check that the version is logged
Execute a short training or prediction command (replace the placeholder arguments with valid values for your data).
or
Look for a line similar to:
The version string should match the value defined in
zamba/version.py.Verify the public version API
No import errors should occur, and the printed version should match the package metadata.