Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue #304 NeMo Guardrails packaging #536

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Jun 4, 2024

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 how examples and chat-ui are packaged, specifically excluding them from site-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 exclude examples and chat-ui directories from being packaged into site-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 in examples/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

@Pouyanpi Pouyanpi requested a review from drazvan June 4, 2024 14:07
@Pouyanpi Pouyanpi self-assigned this Jun 4, 2024
@Pouyanpi Pouyanpi changed the title Fix/issue #304 wrong packaging Fix/issue #304 NeMo Guardrails packaging Jun 4, 2024
Copy link
Collaborator

@drazvan drazvan left a comment

Choose a reason for hiding this comment

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

Nice one, @Pouyanpi!

@drazvan drazvan merged commit 8f42924 into develop Jun 4, 2024
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.

pip package installs unexpected module "examples"
2 participants