Fix/issue #304 NeMo Guardrails packaging #536
Merged
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
This PR introduces several changes to the project's build process and packaging configuration, focusing on the
pyproject.toml
and NeMo Guardrails adjustments. The updates are designed to enhance howexamples
andchat-ui
are packaged, specifically excluding them fromsite-packages
. Additionally, this PR refines our path handling by implementing utility functions that adapt to different environments, whether the package is installed via pip or run from a cloned repository. It resolves #304.Changes
Update
pyproject.toml
: Revised to excludeexamples
andchat-ui
directories from being packaged intosite-packages
. This modification prevents these directories from being unnecessarily deployed in production environments.Update Build Process: Updated
build_wheel.yml
to accommodate the changes in the packaging strategy, ensuring that our CI/CD pipeline reflects the new configuration.Add Utility Functions for Path Management: Added helper functions to manage data paths. These functions dynamically determine the correct paths for accessing package resources, whether the package is installed using pip or directly executed from a cloned repository.
Code Cleanup and Refactoring: Removed
examples/__init__.py
and updated imports inexamples/configs/rag/multi_kb/config.py
to align with the new directory structure. This cleanup reduces otential confusion about the module's status as non-package content.Testing
Thorough testing has been conducted to ensure that these changes do not break existing functionalities. The updates have been validated in both pip-installed environments and directly from source