-
Notifications
You must be signed in to change notification settings - Fork 48
Introduce per application validation for python Samples #120
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
44f395f
Introduce per application validation for python Samples
rahuldevikar761 5d8f4b0
Introduce per application validation for python Samples
rahuldevikar761 078ba38
Introduce per application validation for python Samples
rahuldevikar761 bce6daf
Introduce per application validation for python Samples
rahuldevikar761 5819a30
Introduce per application validation for python Samples
rahuldevikar761 670a82c
Introduce per application validation for python Samples
rahuldevikar761 8f965c5
Introduce per application validation for python Samples
rahuldevikar761 f39dcfa
Introduce per application validation for python Samples
rahuldevikar761 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
121 changes: 121 additions & 0 deletions
121
.github/workflows/ci-python-agentframework-sampleagent.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: CI - Build Python Agent Framework Sample Agent | ||
| permissions: | ||
| contents: read | ||
|
pontemonti marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/agent-framework/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-agentframework-sampleagent.yml' | ||
| pull_request: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/agent-framework/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-agentframework-sampleagent.yml' | ||
|
|
||
| jobs: | ||
| python-agentframework-sampleagent: | ||
| name: Python Agent Framework Sample Agent | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: ./python/agent-framework/sample-agent | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python-version: ['3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install UV package manager | ||
| run: | | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Verify UV installation | ||
| run: uv --version | ||
|
|
||
| - name: Create virtual environment | ||
| run: uv venv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install -e . | ||
|
|
||
| - name: Verify imports | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -c "import agent; print('✓ agent.py imports successfully')" | ||
| python -c "import agent_interface; print('✓ agent_interface.py imports successfully')" | ||
| python -c "import host_agent_server; print('✓ host_agent_server.py imports successfully')" | ||
|
|
||
| - name: Check Python syntax | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -m py_compile agent.py | ||
| python -m py_compile agent_interface.py | ||
| python -m py_compile host_agent_server.py | ||
| python -m py_compile local_authentication_options.py | ||
| python -m py_compile token_cache.py | ||
| python -m py_compile start_with_generic_host.py | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install pytest pytest-asyncio ruff mypy | ||
|
|
||
| - name: Run Ruff linter (non-blocking) | ||
| continue-on-error: true | ||
| run: | | ||
| source .venv/bin/activate | ||
| ruff check . --output-format=github || echo "::warning::Ruff found some issues" | ||
|
|
||
| - name: Check for common issues | ||
| run: | | ||
| source .venv/bin/activate | ||
| echo "Checking for missing dependencies..." | ||
| python -c " | ||
| import importlib.util | ||
| import sys | ||
|
|
||
| required_modules = [ | ||
| 'agent_framework', | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| 'microsoft.agents.hosting.aiohttp', | ||
| 'microsoft.agents.authentication.msal', | ||
| 'microsoft_agents_a365_tooling', | ||
| 'microsoft_agents_a365_observability_core', | ||
| 'dotenv', | ||
| 'aiohttp', | ||
| 'fastapi', | ||
| 'uvicorn', | ||
| 'pydantic' | ||
| ] | ||
|
|
||
| missing = [] | ||
| for module in required_modules: | ||
| if importlib.util.find_spec(module.replace('.', '/').split('/')[0]) is None: | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| missing.append(module) | ||
|
|
||
| if missing: | ||
| print(f'❌ Missing modules: {missing}') | ||
| sys.exit(1) | ||
| else: | ||
| print('✓ All required modules are available') | ||
| " | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Build validation summary | ||
| if: always() | ||
| run: | | ||
| echo "### ✅ Validation Complete for Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Dependencies installed successfully" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Python syntax validation passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Import checks passed" >> $GITHUB_STEP_SUMMARY | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: CI - Build Python Google ADK Sample Agent | ||
|
rahuldevikar761 marked this conversation as resolved.
|
||
| permissions: | ||
| contents: read | ||
|
pontemonti marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/google-adk/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-googleadk-sampleagent.yml' | ||
| pull_request: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/google-adk/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-googleadk-sampleagent.yml' | ||
|
|
||
| jobs: | ||
| python-googleadk-sampleagent: | ||
| name: Python Google ADK Sample Agent | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: ./python/google-adk/sample-agent | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python-version: ['3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install UV package manager | ||
| run: | | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Verify UV installation | ||
| run: uv --version | ||
|
|
||
| - name: Create virtual environment | ||
| run: uv venv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install -e . | ||
|
|
||
| - name: Verify imports | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -c "import agent; print('✓ agent.py imports successfully')" | ||
| python -c "import mcp_tool_registration_service; print('✓ mcp_tool_registration_service.py imports successfully')" | ||
|
|
||
| - name: Check Python syntax | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -m py_compile agent.py | ||
| python -m py_compile mcp_tool_registration_service.py | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install pytest pytest-asyncio ruff mypy | ||
|
|
||
| - name: Run Ruff linter (non-blocking) | ||
| continue-on-error: true | ||
| run: | | ||
| source .venv/bin/activate | ||
| ruff check . --output-format=github || echo "::warning::Ruff found some issues" | ||
|
|
||
| - name: Check for common issues | ||
| run: | | ||
| source .venv/bin/activate | ||
| echo "Checking for missing dependencies..." | ||
| python -c " | ||
| import importlib.util | ||
| import sys | ||
|
|
||
| required_modules = [ | ||
| 'google.adk', | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| 'microsoft.agents.hosting.aiohttp', | ||
| 'microsoft.agents.authentication.msal', | ||
| 'microsoft_agents_a365_tooling', | ||
| 'microsoft_agents_a365_observability_core', | ||
| 'dotenv', | ||
| 'aiohttp', | ||
| 'fastapi', | ||
| 'uvicorn', | ||
| 'pydantic' | ||
| ] | ||
|
|
||
| missing = [] | ||
| for module in required_modules: | ||
| if importlib.util.find_spec(module.replace('.', '/').split('/')[0]) is None: | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| missing.append(module) | ||
|
|
||
| if missing: | ||
| print(f'❌ Missing modules: {missing}') | ||
| sys.exit(1) | ||
| else: | ||
| print('✓ All required modules are available') | ||
| " | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Build validation summary | ||
| if: always() | ||
| run: | | ||
| echo "### ✅ Validation Complete for Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Dependencies installed successfully" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Python syntax validation passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Import checks passed" >> $GITHUB_STEP_SUMMARY | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: CI - Build Python OpenAI Sample Agent | ||
|
rahuldevikar761 marked this conversation as resolved.
|
||
| permissions: | ||
| contents: read | ||
|
rahuldevikar761 marked this conversation as resolved.
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/openai/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-openai-sampleagent.yml' | ||
| pull_request: | ||
| branches: [ main, master ] | ||
| paths: | ||
| - 'python/openai/sample-agent/**/*' | ||
| - '.github/workflows/ci-python-openai-sampleagent.yml' | ||
|
|
||
| jobs: | ||
| python-openai-sampleagent: | ||
| name: Python OpenAI Sample Agent | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: ./python/openai/sample-agent | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python-version: ['3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install UV package manager | ||
| run: | | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Verify UV installation | ||
| run: uv --version | ||
|
|
||
| - name: Create virtual environment | ||
| run: uv venv | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install -e . | ||
|
|
||
| - name: Verify imports | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -c "import agent; print('✓ agent.py imports successfully')" | ||
| python -c "import agent_interface; print('✓ agent_interface.py imports successfully')" | ||
| python -c "import host_agent_server; print('✓ host_agent_server.py imports successfully')" | ||
|
|
||
| - name: Check Python syntax | ||
| run: | | ||
| source .venv/bin/activate | ||
| python -m py_compile agent.py | ||
| python -m py_compile agent_interface.py | ||
| python -m py_compile host_agent_server.py | ||
| python -m py_compile local_authentication_options.py | ||
| python -m py_compile token_cache.py | ||
| python -m py_compile start_with_generic_host.py | ||
|
|
||
| - name: Install dev dependencies | ||
| run: | | ||
| source .venv/bin/activate | ||
| uv pip install pytest pytest-asyncio ruff mypy | ||
|
|
||
| - name: Run Ruff linter (non-blocking) | ||
| continue-on-error: true | ||
| run: | | ||
| source .venv/bin/activate | ||
| ruff check . --output-format=github || echo "::warning::Ruff found some issues" | ||
|
|
||
| - name: Check for common issues | ||
| run: | | ||
| source .venv/bin/activate | ||
| echo "Checking for missing dependencies..." | ||
| python -c " | ||
| import importlib.util | ||
| import sys | ||
|
|
||
| required_modules = [ | ||
| 'openai', | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| 'microsoft.agents.hosting.aiohttp', | ||
| 'microsoft.agents.authentication.msal', | ||
| 'microsoft_agents_a365_tooling', | ||
| 'microsoft_agents_a365_observability_core', | ||
| 'dotenv', | ||
| 'aiohttp', | ||
| 'fastapi', | ||
| 'uvicorn', | ||
| 'pydantic' | ||
| ] | ||
|
|
||
| missing = [] | ||
| for module in required_modules: | ||
| if importlib.util.find_spec(module.replace('.', '/').split('/')[0]) is None: | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
| missing.append(module) | ||
|
|
||
| if missing: | ||
| print(f'❌ Missing modules: {missing}') | ||
| sys.exit(1) | ||
| else: | ||
| print('✓ All required modules are available') | ||
| " | ||
|
rahuldevikar761 marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Build validation summary | ||
| if: always() | ||
| run: | | ||
| echo "### ✅ Validation Complete for Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Dependencies installed successfully" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Python syntax validation passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Import checks passed" >> $GITHUB_STEP_SUMMARY | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.