Python: chore(python): improve dependency range automation#4343
Python: chore(python): improve dependency range automation#4343eavanvalkenburg merged 19 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
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.integrationmarkers 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 |
b6cc6b7 to
707bcf4
Compare
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
d42b45a to
7b5cae9
Compare
7b5cae9 to
fc4fb14
Compare
There was a problem hiding this comment.
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,
)
There was a problem hiding this comment.
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."""
a918444 to
7121ecf
Compare
fb52c54 to
d5300ad
Compare
There was a problem hiding this comment.
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.
- 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>
d5300ad to
ac3db35
Compare
Summary
Closes #902