Conversation
regmibijay
commented
Sep 21, 2025
- add extra deps for cpu or gpu optim
- add preflight checks
- add tests
- adapt documents
- Introduced `check_required_packages` and `check_embedding_provider` functions in `yarp/runtime/preflight_checks.py` to verify the installation of required packages. - Created a base exception class `YarpBaseException` in `yarp/exceptions/base.py` for consistent error handling across YARP. - Updated local memory exceptions to inherit from `YarpBaseException` for better exception hierarchy. - Added `EmbeddingProviderNotFoundException` to handle cases where the embedding provider is not found. - Implemented unit tests for preflight checks in `tests/test_preflight_checks.py` to ensure proper functionality. - Configured GitHub Actions workflow for automated testing on pull requests to the master branch.
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates packaging by introducing optional dependencies for CPU/GPU optimization, adds preflight checks for required packages, and refactors the exception hierarchy. The changes enable more flexible installation options while ensuring proper error handling when dependencies are missing.
- Refactors exception hierarchy to use unified
YarpBaseExceptionbase class - Introduces preflight checks that validate required packages at import time
- Adds optional
[cpu]and[gpu]package extras for targeted dependency installation
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarp/runtime/preflight_checks.py | Implements package validation and embedding provider checks |
| yarp/exceptions/runtime.py | Adds new runtime exception for missing embedding providers |
| yarp/exceptions/base.py | Introduces unified base exception class |
| yarp/exceptions/local_memory_exceptions.py | Refactors to use new base exception |
| yarp/init.py | Integrates preflight checks at import time and updates version |
| tests/test_preflight_checks.py | Comprehensive test coverage for preflight functionality |
| pyproject.toml | Restructures dependencies into core and optional groups |
| Documentation files | Updates installation instructions and error handling examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
yarp/__init__.py
Outdated
| from yarp.runtime.preflight_checks import check_required_packages | ||
|
|
||
| __version__ = "0.2.1" | ||
| check_required_packages() |
There was a problem hiding this comment.
Running preflight checks at import time can slow down module imports and may cause import failures in environments where optional dependencies are intentionally not installed. Consider making the preflight checks optional or lazy-loaded to avoid blocking imports.
| check_required_packages() |
| process.memory_info().rss | ||
|
|
There was a problem hiding this comment.
This line computes memory usage but doesn't assign the result to a variable or use it. The computation has no effect and should either be removed or assigned to a variable like final_memory as it was before.
| process.memory_info().rss |
…s are called after version definition