Repository navigation
Commit cbb8059
authored
Python: Drop 3.10 support and expand CI coverage through 3.14 (#14708)
### Motivation and Context
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
1. Why is this change required?
2. What problem does it solve?
3. What scenario does it contribute to?
4. If it fixes an open issue, please link to the issue here.
-->
Retire Python 3.10 support and its compatibility code. Align the SDK's
supported versions, CI coverage, and developer setup with Python 3.11
through 3.14. Use Python 3.14 as the local development and
integration-test default.
This intentionally raises the minimum supported Python version from 3.10
to 3.11. Python 3.14 is the highest supported and tested version. Keep
the existing minimum-only `requires-python = ">=3.11"` policy; do not
add an installation upper bound.
### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
- Require Python 3.11+, update package classifiers through Python 3.14,
and remove Python 3.10-specific ONNX pins and lockfile branches while
preserving upstream security updates and registry URLs.
- Replace obsolete `Self` and `NotRequired` backports with
standard-library imports. Remove the Python 3.10 `AnyType` shim,
obsolete test skips, and the event-loop workaround. Apply Python 3.11
syntax upgrades, including built-in `TimeoutError` and `datetime.UTC`.
Keep import guards still needed by Python 3.11.
- Run Python 3.11–3.14 as required unit-test jobs across the existing
OS/test-suite matrix: 22 jobs, preserving the Python 3.11/macOS
exclusion. Move all six integration-test matrices to Python 3.14 and
explicitly provision interpreters before uv.
- Use uv 0.13 and per-environment `uv pip install` resolution in unit
CI, integration CI, and local setup, including the development
dependency group. Use `uv run --no-sync` for subsequent tools and VS
Code tasks so the shared universal lock does not restore incompatible
NumPy 1.x. MCP sample subprocesses also use `--no-sync`.
- Add an AutoGen dependency marker excluding Python 3.14 and
Windows/Python 3.13, including all-extras installs. Its NumPy <2
constraint forces old scientific and gRPC packages; NumPy 1.26.4 crashes
during import on Windows/Python 3.13. Preserve AutoGen coverage on
Python 3.11–3.12 and Linux/macOS Python 3.13. Local pytest collection
and CI follow the same exclusion policy.
- Keep all other extras and connector tests enabled across the supported
matrix. Remove abandoned newer-version exclusions and native-build
workarounds. Keep the separate Dapr suite and its dependencies.
- Constrain `azure-ai-projects` to `>=1.0,<2.0`: SK's Azure AI agent
implementation requires the classic APIs removed in Projects 2.x. Add a
regression test that checks the actual installed client's agent, file,
thread, and run operations without cloud calls.
- Replace the unmaintained `nest-asyncio` dependency and imports with
`nest-asyncio2>=1.7.4,<2`. The old patch breaks Python 3.14 task
detection, causing OpenAI/sniffio, AnyIO/MCP, and notebook timeout
failures. Update nested-loop MCP samples too. Add regression tests for
nested template invocation, async-library detection, timeout handling,
and restoration of the outer task context.
- Disable matrix fail-fast so one failure does not cancel the remaining
required jobs. Run pytest through Python with unbuffered output and
faulthandler for native-crash diagnostics.
- Fix typing reflection: do not recurse into Union origin classes when
parsing function annotations, and read model annotations from the class
when building schemas from instances. Add regression cases for optional
dictionary annotations and inherited/optional model fields.
- Default local development to Python 3.14. Update the Makefile
interpreter installation list, VS Code choices, setup instructions,
READMEs, and sample requirements. Document the CI dependency policy and
runtime compatibility constraints.
- Add regression coverage for `Any` return annotations in message and
RPC handlers.
**Validation**
From `python/`, using an isolated stable Python 3.14.9 environment with
`VIRTUAL_ENV`/`UV_PROJECT_ENVIRONMENT` pointing to its session-only
directory:
- `uv pip install --editable . --requirements pyproject.toml
--all-extras --group dev --upgrade
--prerelease=if-necessary-or-explicit` — passed; installed Azure
Projects 1.0.0, nest-asyncio2 1.7.4, and the full supported extras/dev
dependency set.
- `uv run --no-sync pytest tests/unit
--ignore=tests/unit/processes/dapr_runtime --disable-warnings -o
addopts=-ra -q` — passed: 4,947 passed, 1 skipped, 5 xfailed.
- `uv run --no-sync pytest tests/unit/prompt_template
tests/unit/agents/azure_ai_agent --disable-warnings -o addopts=-ra -q` —
passed before the stable-interpreter recheck: 328 tests. The full
stable-interpreter run above includes these tests.
From the repository root unless noted:
- `cd python && .venv/bin/pytest tests/unit/prompt_template
tests/unit/agents/azure_ai_agent --disable-warnings -o addopts=-ra -q` —
passed on Python 3.11: 328 tests.
- `python/.venv/bin/pre-commit run --all-files --config
python/.pre-commit-config.yaml` — passed, including pyupgrade, Ruff,
formatting, lockfile consistency, and Bandit.
- `uv build --project python --out-dir "$BUILD_OUTPUT"` — passed, with
`BUILD_OUTPUT` set to the session-only artifact directory; built the
source distribution and wheel. uv reports the existing
`if-necessary-or-explicit` deprecation warning.
- `git diff --check` — passed.
Also exercised the failing async paths on stable Python 3.14.9 after
nested template rendering: an actual Azure OpenAI SDK request with an
in-memory HTTP mock, stdio initialization/tool listing for both MCP
sample servers, and execution of a Python 3.14 notebook cell using
`asyncio.timeout`. All passed without cloud calls. The old nest-asyncio
failure was independently reproduced without external services.
Verified the support matrix, metadata, AutoGen marker/collection policy
on all 12 OS/Python combinations, all six integration
installers/runners, and preservation of existing locked package versions
and registry/artifact URLs. Windows and Linux Python 3.14 installation
resolution checks select NumPy/SciPy wheels without AutoGen. Previously
verified rejection of Python 3.10 during wheel installation.
Live service integration tests were not run locally. Regular PR checks
skip those jobs for fork PRs; the merge queue must run them to establish
the latest commit's live-service results. The latest fixes do not skip
additional integration tests.
### Contribution Checklist
<!-- Before submitting this PR, please make sure: -->
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄1 parent 9137b35 commit cbb8059
66 files changed
Lines changed: 408 additions & 1909 deletions
File tree
- .github/workflows
- python
- .vscode
- samples
- concepts/mcp
- servers
- demos
- booking_restaurant
- guided_conversations
- mcp_server
- mcp_with_oauth
- server
- getting_started_with_agents/copilot_studio
- learn_resources
- semantic_kernel
- agents
- azure_ai
- open_ai
- orchestration
- runtime/core
- telemetry
- connectors
- ai
- mistral_ai/services
- contents
- history_reducer
- data
- functions
- prompt_template/utils
- schema
- tests
- integration/cross_language
- unit
- agents
- azure_ai_agent
- orchestration
- runtime
- core_plugins
- data
- functions
- kernel
- prompt_template
- schema
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | | - | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
161 | | - | |
| 166 | + | |
162 | 167 | | |
163 | 168 | | |
164 | 169 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
182 | 187 | | |
183 | 188 | | |
184 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
188 | | - | |
| 197 | + | |
189 | 198 | | |
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
193 | | - | |
| 202 | + | |
| 203 | + | |
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
| |||
202 | 212 | | |
203 | 213 | | |
204 | 214 | | |
205 | | - | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
| |||
215 | 225 | | |
216 | 226 | | |
217 | 227 | | |
218 | | - | |
| 228 | + | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| |||
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
229 | 243 | | |
230 | 244 | | |
231 | 245 | | |
232 | | - | |
| 246 | + | |
233 | 247 | | |
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
237 | | - | |
| 251 | + | |
| 252 | + | |
238 | 253 | | |
239 | 254 | | |
240 | 255 | | |
| |||
254 | 269 | | |
255 | 270 | | |
256 | 271 | | |
257 | | - | |
| 272 | + | |
258 | 273 | | |
259 | 274 | | |
260 | 275 | | |
| |||
265 | 280 | | |
266 | 281 | | |
267 | 282 | | |
268 | | - | |
| 283 | + | |
269 | 284 | | |
270 | 285 | | |
271 | 286 | | |
| |||
277 | 292 | | |
278 | 293 | | |
279 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
280 | 299 | | |
281 | 300 | | |
282 | 301 | | |
283 | | - | |
| 302 | + | |
284 | 303 | | |
285 | 304 | | |
286 | 305 | | |
287 | 306 | | |
288 | 307 | | |
289 | | - | |
| 308 | + | |
| 309 | + | |
290 | 310 | | |
291 | 311 | | |
292 | 312 | | |
| |||
307 | 327 | | |
308 | 328 | | |
309 | 329 | | |
310 | | - | |
| 330 | + | |
311 | 331 | | |
312 | 332 | | |
313 | 333 | | |
| |||
320 | 340 | | |
321 | 341 | | |
322 | 342 | | |
323 | | - | |
| 343 | + | |
324 | 344 | | |
325 | 345 | | |
326 | 346 | | |
| |||
346 | 366 | | |
347 | 367 | | |
348 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
349 | 373 | | |
350 | 374 | | |
351 | 375 | | |
352 | | - | |
| 376 | + | |
353 | 377 | | |
354 | 378 | | |
355 | 379 | | |
356 | 380 | | |
357 | 381 | | |
358 | | - | |
| 382 | + | |
| 383 | + | |
359 | 384 | | |
360 | 385 | | |
361 | 386 | | |
| |||
368 | 393 | | |
369 | 394 | | |
370 | 395 | | |
371 | | - | |
| 396 | + | |
372 | 397 | | |
373 | 398 | | |
374 | 399 | | |
| |||
381 | 406 | | |
382 | 407 | | |
383 | 408 | | |
384 | | - | |
| 409 | + | |
385 | 410 | | |
386 | 411 | | |
387 | 412 | | |
| |||
407 | 432 | | |
408 | 433 | | |
409 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
410 | 439 | | |
411 | 440 | | |
412 | 441 | | |
413 | | - | |
| 442 | + | |
414 | 443 | | |
415 | 444 | | |
416 | 445 | | |
417 | 446 | | |
418 | 447 | | |
419 | | - | |
| 448 | + | |
| 449 | + | |
420 | 450 | | |
421 | 451 | | |
422 | 452 | | |
| |||
467 | 497 | | |
468 | 498 | | |
469 | 499 | | |
470 | | - | |
| 500 | + | |
471 | 501 | | |
472 | 502 | | |
473 | 503 | | |
474 | 504 | | |
475 | 505 | | |
476 | 506 | | |
477 | 507 | | |
478 | | - | |
| 508 | + | |
479 | 509 | | |
480 | 510 | | |
481 | 511 | | |
482 | 512 | | |
483 | 513 | | |
484 | 514 | | |
485 | | - | |
| 515 | + | |
486 | 516 | | |
487 | 517 | | |
488 | 518 | | |
489 | 519 | | |
490 | 520 | | |
491 | 521 | | |
492 | | - | |
| 522 | + | |
493 | 523 | | |
494 | 524 | | |
495 | 525 | | |
496 | 526 | | |
497 | 527 | | |
498 | 528 | | |
499 | | - | |
| 529 | + | |
500 | 530 | | |
501 | 531 | | |
502 | 532 | | |
503 | 533 | | |
504 | 534 | | |
505 | 535 | | |
506 | | - | |
| 536 | + | |
507 | 537 | | |
508 | 538 | | |
509 | 539 | | |
510 | 540 | | |
511 | 541 | | |
512 | 542 | | |
513 | | - | |
| 543 | + | |
514 | 544 | | |
515 | 545 | | |
516 | 546 | | |
517 | 547 | | |
518 | 548 | | |
519 | 549 | | |
520 | | - | |
| 550 | + | |
521 | 551 | | |
522 | 552 | | |
523 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments