Repository navigation
Python: update dependencies - #14360
Eduard van Valkenburg (eavanvalkenburg) merged 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to dependency/version updates with consistent constraints and regenerated lockfiles aligning with the updated dependency declarations.
Pull request overview
This pull request refreshes Python dependencies for the MCP OAuth demo and the repo’s Hugging Face extra set, updating versions and regenerating the corresponding uv.lock files to keep dependency resolution reproducible.
Changes:
- Bump the MCP OAuth demo server to
mcp>=1.28.1and explicitly declarepython-multipartandstarletteas direct dependencies. - Regenerate the demo
uv.lockfiles, including updatingaiohttp(client demo) and adding new transitive packages in the server lock (e.g.,cryptography,pyjwt,pywin32). - Update the repo-level
hugging_faceextra to requiretransformers[torch] >= 5.5.0,< 6.0.
File summaries
| File | Description |
|---|---|
| python/samples/demos/mcp_with_oauth/uv.lock | Regenerated lockfile; updates aiohttp to 3.14.3 and refreshes resolved artifacts. |
| python/samples/demos/mcp_with_oauth/server/uv.lock | Regenerated server lockfile for mcp 1.28.1 and newly resolved transitive dependencies. |
| python/samples/demos/mcp_with_oauth/server/pyproject.toml | Updates demo server dependency constraints (notably mcp>=1.28.1, plus python-multipart/starlette). |
| python/pyproject.toml | Raises the minimum transformers[torch] version in the hugging_face optional dependency group. |
Review details
- Files reviewed: 2/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): bf5bfea23820
Model: claude-opus-4.8
Overview
This is a focused dependency-bump PR: it raises the hugging_face extra's transformers[torch] lower bound from >= 4.28 to >= 5.5.0 in python/pyproject.toml, adds explicit mcp>=1.28.1, python-multipart>=0.0.30, and starlette>=1.1.0 floors to the standalone mcp_with_oauth sample, and regenerates three uv.lock files. No source or test code changes. The strongest guardrails are the machine-verified lock resolutions (transformers 5.5.0's torch extra is unversioned, so the pre-existing torch==2.13.0 pin still satisfies it; wheels exist across the supported platform matrix; both sample lockfiles agree on mcp==1.28.1) and the fact that all bumped packages resolve to files.pythonhosted.org with sha256 pins. The residual risk is that the connector's transformers/sentence-transformers call sites are exercised only by mocked unit tests, so runtime API parity against the 5.x major is unverified — a validation gap in unchanged code, not a defect anchored to this diff.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Transformers 5 removes the `text2text-generation`, `summarization` and `translation` pipeline tasks, so `HuggingFaceTextCompletion` raised `KeyError: Unknown task text2text-generation` on construction. Replace the pipeline call for the seq2seq tasks with a small adapter built on `AutoModelForSeq2SeqLM` and `AutoTokenizer`, keeping the behaviour the removed pipelines provided: - the same output keys (`summary_text` for summarization, `generated_text` otherwise), so `_create_text_content` is unchanged - the model's task specific prefix (e.g. `summarize: `) is still prepended before tokenization - one record per generated sequence for `num_return_sequences > 1` - `model_kwargs` are shared with the tokenizer load, as `pipeline()` did - pipeline only options are dropped with a warning instead of reaching `generate()` `text-generation` keeps using `pipeline()`. Add unit tests covering the adapter, the option routing, device placement and prefix resolution. The previous tests mocked `pipeline()` and so did not catch the incompatibility. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
The OpenAI and Azure OpenAI Assistants API has been retired. Every request now returns HTTP 410 (`assistants_api_deprecated`) on Azure OpenAI and HTTP 404 on OpenAI, so the assistant agent integration tests and the `step1_openai_assistant` concept sample can no longer run against a live service. Skip them until the assistant agents and the sample are migrated to the replacement API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2
Annotate the local generator variable as the union of the two types it can hold, so the sequence-to-sequence branch and the pipeline branch are both accepted. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c2d4dd29-0a9c-4f43-b2ce-243e19ec34b2
Summary
Hugging Face connector
Transformers 5 removes the
text2text-generation,summarizationandtranslationpipeline tasks, soHuggingFaceTextCompletionraisedKeyError: Unknown task text2text-generationon construction.Those two tasks now use a small adapter built on
AutoModelForSeq2SeqLMandAutoTokenizerthat preserves what the removed pipelines did:summary_textfor summarization,generated_textotherwise), so the content mapping is unchangedsummarize:) is still prepended before tokenizationnum_return_sequences > 1model_kwargsare shared with the tokenizer load, aspipeline()didgenerate()text-generationkeeps usingpipeline(). There is no public API change.The previous unit tests mocked
pipeline()and so did not catch the incompatibility. New tests cover the adapter, option routing, device placement, output mapping and prefix resolution.Temporarily disabled tests
The OpenAI and Azure OpenAI Assistants API has been retired. Live requests now return HTTP 410 (
assistants_api_deprecated) on Azure OpenAI and HTTP 404 on OpenAI, so these tests cannot exercise a functioning service.tests/integration/agents/openai_assistant_agent/test_openai_assistant_agent_integration.pyare skipped at module level, before the live-service fixture runsstep1_openai_assistantcase intests/samples/test_concepts.pyis skipped unconditionallytests/unit/agents/openai_assistantremain enabled and passingThe skips are intentionally limited to live tests for the retired API. Comments next to each skip include the migration guide and state that the skip should be removed after the agents and sample move to the replacement API.
Validation