Skip to content

Feat/consolidate packaging#4

Merged
regmibijay merged 3 commits intomasterfrom
feat/consolidate-packaging
Sep 21, 2025
Merged

Feat/consolidate packaging#4
regmibijay merged 3 commits intomasterfrom
feat/consolidate-packaging

Conversation

@regmibijay
Copy link
Owner

  • add extra deps for cpu or gpu optim
  • add preflight checks
  • add tests
  • adapt documents

Bijay Regmi added 2 commits September 21, 2025 23:52
- 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.
@regmibijay regmibijay requested a review from Copilot September 21, 2025 21:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 YarpBaseException base 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()
Copy link

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
check_required_packages()

Copilot uses AI. Check for mistakes.
Comment on lines +220 to 221
process.memory_info().rss

Copy link

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
process.memory_info().rss

Copilot uses AI. Check for mistakes.
@regmibijay regmibijay merged commit c981296 into master Sep 21, 2025
4 checks passed
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.

1 participant