Skip to content

Python: chore(python): improve dependency range automation#4343

Merged
eavanvalkenburg merged 19 commits intomicrosoft:mainfrom
eavanvalkenburg:dependency_strategy
Mar 13, 2026
Merged

Python: chore(python): improve dependency range automation#4343
eavanvalkenburg merged 19 commits intomicrosoft:mainfrom
eavanvalkenburg:dependency_strategy

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Feb 27, 2026

Summary

  • tighten dependency bounds and coding standards guidance
  • add dependency range validation workflow with issue/PR automation
  • update related tests and dependency pins for compatibility

Closes #902

Copilot AI review requested due to automatic review settings February 27, 2026 10:53
@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner February 27, 2026 10:53
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python lab Agent Framework Lab labels Feb 27, 2026
@github-actions github-actions bot changed the title chore(python): improve dependency range automation Python: chore(python): improve dependency range automation Feb 27, 2026
Copy link
Contributor

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 improves Python dependency management automation by introducing a comprehensive dependency range validation system, tightening dependency bounds across packages, and enhancing test organization.

Changes:

  • Adds automated dependency range validation script and GitHub Actions workflow to continuously validate and update dependency upper bounds
  • Tightens dependency version constraints across all packages to follow documented standards for stable (>=1.0.0), prerelease, and pre-1.0 dependencies
  • Improves test organization by adding @pytest.mark.integration markers and moving Azure-specific embedding tests to a dedicated file
  • Updates coding standards documentation with clearer dependency versioning guidelines and corrects code examples

Reviewed changes

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

Show a summary per file
File Description
python/scripts/validate_dependency_ranges.py New script that validates dependency ranges by testing candidate versions and updating pyproject.toml files
.github/workflows/python-dependency-range-validation.yml New workflow that runs validation, creates issues for failures, and opens PRs with updated bounds
python/pyproject.toml Adds validate-dependency-ranges poe task
python/packages/*/pyproject.toml Tightens dependency bounds and adds integration test markers to test commands
python/packages/core/tests/openai/test_openai_embedding_client.py Removes Azure tests (moved to dedicated file) and adds integration markers
python/packages/core/tests/azure/test_azure_embedding_client.py New file with Azure OpenAI embedding tests and proper test isolation
python/packages/azure-ai-search/tests/test_aisearch_context_provider.py Adds fixture to clear ambient Azure Search environment variables for test isolation
python/CODING_STANDARD.md Clarifies external dependency versioning guidelines and fixes code example
python/packages/core/agent_framework/_types.py Reorders docstring sections (Returns before Raises) following Python conventions
python/packages/core/agent_framework/_workflows/_workflow.py Style improvement: combines variable assignment and yield statements
python/packages/devui/agent_framework_devui/_deployment.py Style improvement: combines variable assignment and yield statements
python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Reorders docstring sections (Returns before Raises)
.gitignore Adds dependency-range-results.json to ignored files

@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 27, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _workflow.py2671992%88, 269–271, 273–274, 292, 296, 430, 618, 639, 695, 707, 713, 718, 738–740, 753
packages/core/agent_framework/openai
   _responses_client.py81512884%312–315, 319–320, 325–326, 336–337, 344, 359–365, 386, 394, 417, 514, 516, 613, 672, 674, 676, 678, 746, 760, 840, 850, 855, 898, 977, 994, 1007, 1069, 1160, 1165, 1169–1171, 1175–1176, 1191, 1235, 1264, 1270, 1280, 1286, 1291, 1297, 1302–1303, 1364, 1386–1387, 1402–1403, 1421–1422, 1463–1466, 1628, 1683, 1685, 1765–1773, 1895, 1950, 1965, 1985–1995, 2008, 2019–2023, 2037, 2051–2062, 2071, 2103–2106, 2114–2115, 2117–2119, 2133–2135, 2145–2146, 2152, 2167
TOTAL23919262789% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
5218 20 💤 0 ❌ 0 🔥 1m 24s ⏱️

@eavanvalkenburg eavanvalkenburg force-pushed the dependency_strategy branch 2 times, most recently from d42b45a to 7b5cae9 Compare March 6, 2026 15:27
Copilot AI review requested due to automatic review settings March 10, 2026 10:08
Copy link
Contributor

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

Copilot reviewed 35 out of 37 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

python/packages/core/tests/openai/test_openai_embedding_client.py:16

  • The Azure embedding client import was removed, but this file still references AzureOpenAIEmbeddingClient (unit + integration tests) and also uses skip_if_azure_openai_integration_tests_disabled after its definition was deleted. As-is, these tests will raise NameError during collection. Either re-add the import/skip marker here, or (preferably) remove the Azure-specific tests from this file now that they live in tests/azure/test_azure_embedding_client.py.
from openai.types import Embedding as OpenAIEmbedding
from openai.types.create_embedding_response import Usage

from agent_framework.openai import (
    OpenAIEmbeddingClient,
    OpenAIEmbeddingOptions,
)

Copilot AI review requested due to automatic review settings March 10, 2026 10:38
Copy link
Contributor

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

Copilot reviewed 43 out of 45 changed files in this pull request and generated 8 comments.

Copilot AI review requested due to automatic review settings March 11, 2026 08:13
Copy link
Contributor

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

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

Comments suppressed due to low confidence (1)

python/packages/core/tests/openai/test_openai_embedding_client.py:204

  • The integration marker is applied twice on this test. Remove the duplicate decorator to avoid redundant markers and keep pytest output/selection clean.
@skip_if_openai_integration_tests_disabled
@pytest.mark.flaky
@pytest.mark.integration
async def test_integration_openai_get_embeddings() -> None:
    """End-to-end test of OpenAI embedding generation."""

Copilot AI review requested due to automatic review settings March 11, 2026 08:37
Copy link
Contributor

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

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

Copilot AI review requested due to automatic review settings March 11, 2026 13:56
Copilot AI review requested due to automatic review settings March 12, 2026 11:01
Copy link
Contributor

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

Copilot reviewed 59 out of 62 changed files in this pull request and generated 1 comment.


You can also share your feedback on Copilot code review. Take the survey.

eavanvalkenburg and others added 18 commits March 13, 2026 10:40
- 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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…0 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 microsoft#902

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Mar 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Mar 13, 2026
Merged via the queue into microsoft:main with commit 50fdcba Mar 13, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lab Agent Framework Lab python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: ensure dependency bounds are as loose as possible

6 participants