Skip to content

Conversation

@ashenfad
Copy link
Owner

This PR adopts Modal's add_local_python_source for handling local Python module deps for the modal host.

@ashenfad ashenfad requested a review from Copilot December 29, 2025 21:02
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 adds support for local Python modules in Modal deployments by utilizing Modal's add_local_python_source API. The implementation detects local packages (those not installed from PyPI), separates them from PyPI dependencies, and handles them appropriately during image building.

Key Changes:

  • Adds detection logic to distinguish local modules from PyPI packages
  • Implements optional dependency detection for packages with extras
  • Integrates local package handling into Modal's image build process

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
agex/agent/registration.py Adds _is_local_module() helper to detect local packages and _get_installed_optional_deps() to find installed optional dependencies; updates dependencies property to populate local_packages
agex/host/dependencies.py Adds local_packages field to Dependencies dataclass and includes it in the ID hash for cache invalidation
agex/host/modal.py Uses add_local_python_source() to mount local packages in Modal images after pip installs
tests/agex/test_dependencies.py Adds test coverage for optional dependency detection functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ashenfad ashenfad merged commit 1ce0f5d into main Dec 29, 2025
7 checks passed
@ashenfad ashenfad deleted the modal-local branch December 29, 2025 21:16
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.

2 participants