mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
50fdcbaf57
* chore(python): improve dependency range automation - tighten dependency bounds and coding standards guidance\n- add dependency range validation workflow, reporting, and issue automation\n- update related tests and dependency pins for compatibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * updated text and pyarrow * new lock * fixed workflow * updated deps * fix tiktoken * chore(python): refine dependency validation workflows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(python): add high-level dependency validation comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * WIP * added additional comments and excludes * added dev dependency handling and workflow and updates to package ranges * added readme and simplified commands * fix markers * chore(python): address dependency review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Tighten dependency bounds, remove stale overrides, restore Python 3.10 support - Apply dependency bound policy across all packages: stable >=1.0 deps use >=floor,<next_major; pre-1.0/prerelease deps use validated hard-bounded ranges - Remove stale root tool.uv.override-dependencies (uvicorn, websockets, grpcio) - Lower github_copilot requires-python to >=3.10 with github-copilot-sdk gated behind python_version >= 3.11 marker; import raises ImportError on 3.10 - Skip github_copilot pyright/mypy/test tasks on Python <3.11 - Use version-conditional pyrightconfig for samples on Python 3.10 - Add compatibility fix in core responses client for older openai typed dicts - Normalize uv.lock prerelease mode and refresh dev dependencies - Update CODING_STANDARD.md, DEV_SETUP.md, and package management skill docs Closes #902 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * small tweaks * add note in workflow * fix workflows and several versions * fix duplicate --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
104 lines
3.0 KiB
YAML
104 lines
3.0 KiB
YAML
name: Python - Lab Tests
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: ["main"]
|
|
paths:
|
|
- "python/packages/lab/**"
|
|
merge_group:
|
|
branches: ["main"]
|
|
schedule:
|
|
- cron: "0 0 * * *" # Run at midnight UTC daily
|
|
|
|
env:
|
|
# Configure a constant location for the uv cache
|
|
UV_CACHE_DIR: /tmp/.uv-cache
|
|
|
|
jobs:
|
|
paths-filter:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
outputs:
|
|
pythonChanges: ${{ steps.filter.outputs.python}}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
python:
|
|
- 'python/**'
|
|
# run only if 'python' files were changed
|
|
- name: python tests
|
|
if: steps.filter.outputs.python == 'true'
|
|
run: echo "Python file"
|
|
# run only if not 'python' files were changed
|
|
- name: not python tests
|
|
if: steps.filter.outputs.python != 'true'
|
|
run: echo "NOT python file"
|
|
|
|
python-lab-tests:
|
|
name: Python Lab Tests
|
|
needs: paths-filter
|
|
if: needs.paths-filter.outputs.pythonChanges == 'true'
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
# TODO(ekzhu): re-enable macos-latest when this is fixed: https://github.com/actions/runner-images/issues/11881
|
|
os: [ubuntu-latest, windows-latest]
|
|
env:
|
|
UV_PYTHON: ${{ matrix.python-version }}
|
|
permissions:
|
|
contents: read
|
|
defaults:
|
|
run:
|
|
working-directory: python
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up python and install the project
|
|
id: python-setup
|
|
uses: ./.github/actions/python-setup
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
os: ${{ runner.os }}
|
|
exclude-packages: ${{ matrix.python-version == '3.10' && 'agent-framework-github-copilot' || '' }}
|
|
env:
|
|
# Configure a constant location for the uv cache
|
|
UV_CACHE_DIR: /tmp/.uv-cache
|
|
|
|
# Lab specific tests
|
|
- name: Run lab tests
|
|
run: cd packages/lab && uv run poe test
|
|
|
|
- name: Run resource-intensive lab tests
|
|
run: cd packages/lab && uv run pytest -m "resource_intensive and not integration" --junitxml=test-results-resource-intensive.xml
|
|
|
|
- name: Run lab lint
|
|
run: cd packages/lab && uv run poe lint
|
|
|
|
- name: Run lab format check
|
|
run: cd packages/lab && uv run poe fmt --check
|
|
|
|
- name: Run lab type checking
|
|
run: cd packages/lab && uv run poe pyright
|
|
|
|
- name: Run lab mypy
|
|
run: cd packages/lab && uv run poe mypy
|
|
|
|
# Surface failing tests
|
|
- name: Surface failing tests
|
|
if: always()
|
|
uses: pmeier/pytest-results-action@v0.7.2
|
|
with:
|
|
path: ./python/packages/lab/**.xml
|
|
summary: true
|
|
display-options: fEX
|
|
fail-on-empty: false
|
|
title: Lab Test Results
|