From 62058988fa6d979d096cc94489a85aa06dd89e2a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 06:51:42 +0000 Subject: [PATCH 1/3] Initial plan From 90aceab19f6213fa5785cd07501e58de3e259e67 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 06:53:37 +0000 Subject: [PATCH 2/3] Drop Python 3.9 support, bump min version to 3.10 Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/6119c5fc-1bfd-4eea-82e3-213c2040737c Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .chronus/changes/python-drop-py39-2026-04-27-06-52-15.md | 7 +++++++ packages/typespec-python/eng/scripts/ci/config/mypy.ini | 2 +- packages/typespec-python/eng/scripts/ci/config/pylintrc | 2 +- .../eng/scripts/ci/config/pyrightconfig.json | 2 +- packages/typespec-python/eng/scripts/ci/run_pylint.py | 2 +- packages/typespec-python/eng/scripts/setup/install.py | 6 +++--- packages/typespec-python/eng/scripts/setup/prepare.py | 4 ++-- packages/typespec-python/eng/scripts/setup/run-python3.ts | 2 +- 8 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .chronus/changes/python-drop-py39-2026-04-27-06-52-15.md diff --git a/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md b/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md new file mode 100644 index 0000000000..6e27fb56f2 --- /dev/null +++ b/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md @@ -0,0 +1,7 @@ +--- +changeKind: breaking +packages: + - "@azure-tools/typespec-python" +--- + +Drop support for Python 3.9. The minimum supported Python version is now 3.10. diff --git a/packages/typespec-python/eng/scripts/ci/config/mypy.ini b/packages/typespec-python/eng/scripts/ci/config/mypy.ini index cfd4a49719..79248291b0 100644 --- a/packages/typespec-python/eng/scripts/ci/config/mypy.ini +++ b/packages/typespec-python/eng/scripts/ci/config/mypy.ini @@ -1,6 +1,6 @@ # global configurations [mypy] -python_version = 3.9 +python_version = 3.10 # Exclude mypy check for sub client tests exclude = (.*azure/clientgenerator/core/clientinitialization/operations/_operations\.py|.*azure/clientgenerator/core/clientinitialization/aio/operations/_operations\.py) diff --git a/packages/typespec-python/eng/scripts/ci/config/pylintrc b/packages/typespec-python/eng/scripts/ci/config/pylintrc index ad23a561c6..fa3bb5698c 100644 --- a/packages/typespec-python/eng/scripts/ci/config/pylintrc +++ b/packages/typespec-python/eng/scripts/ci/config/pylintrc @@ -1,5 +1,5 @@ [MASTER] -py-version=3.9 +py-version=3.10 ignore-patterns=test_*,conftest,setup reports=no diff --git a/packages/typespec-python/eng/scripts/ci/config/pyrightconfig.json b/packages/typespec-python/eng/scripts/ci/config/pyrightconfig.json index bebfe77f91..ac35c7ea8a 100644 --- a/packages/typespec-python/eng/scripts/ci/config/pyrightconfig.json +++ b/packages/typespec-python/eng/scripts/ci/config/pyrightconfig.json @@ -3,6 +3,6 @@ "reportTypeCommentUsage": true, "reportMissingImports": false, "reportAttributeAccessIssue": false, - "pythonVersion": "3.9", + "pythonVersion": "3.10", "exclude": ["**/build/**"] } diff --git a/packages/typespec-python/eng/scripts/ci/run_pylint.py b/packages/typespec-python/eng/scripts/ci/run_pylint.py index 3e8bbf220e..8efe2fe1bb 100644 --- a/packages/typespec-python/eng/scripts/ci/run_pylint.py +++ b/packages/typespec-python/eng/scripts/ci/run_pylint.py @@ -51,7 +51,7 @@ def _single_dir_pylint(mod): "--output-format=parseable", "--recursive=y", "--ignore=build", - "--py-version=3.9", + "--py-version=3.10", str(inner_class.absolute()), ] ) diff --git a/packages/typespec-python/eng/scripts/setup/install.py b/packages/typespec-python/eng/scripts/setup/install.py index cdeba45e97..865aaacc84 100644 --- a/packages/typespec-python/eng/scripts/setup/install.py +++ b/packages/typespec-python/eng/scripts/setup/install.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- import sys -if not sys.version_info >= (3, 9, 0): - raise Exception("Autorest for Python extension requires Python 3.9 at least") +if not sys.version_info >= (3, 10, 0): + raise Exception("Autorest for Python extension requires Python 3.10 at least") try: from package_manager import detect_package_manager, PackageManagerNotFoundError @@ -25,4 +25,4 @@ raise Exception("Your Python installation doesn't have venv available") -# Now we have a package manager (uv or pip) and Py >= 3.9 and check is over +# Now we have a package manager (uv or pip) and Py >= 3.10 and check is over diff --git a/packages/typespec-python/eng/scripts/setup/prepare.py b/packages/typespec-python/eng/scripts/setup/prepare.py index 045442ffb6..549ae045ea 100644 --- a/packages/typespec-python/eng/scripts/setup/prepare.py +++ b/packages/typespec-python/eng/scripts/setup/prepare.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- import sys -if not sys.version_info >= (3, 9, 0): - raise Exception("Autorest for Python extension requires Python 3.9 at least") +if not sys.version_info >= (3, 10, 0): + raise Exception("Autorest for Python extension requires Python 3.10 at least") from pathlib import Path from package_manager import create_venv_with_package_manager, install_packages diff --git a/packages/typespec-python/eng/scripts/setup/run-python3.ts b/packages/typespec-python/eng/scripts/setup/run-python3.ts index 9c5d9499ed..7916e71bde 100644 --- a/packages/typespec-python/eng/scripts/setup/run-python3.ts +++ b/packages/typespec-python/eng/scripts/setup/run-python3.ts @@ -11,7 +11,7 @@ import { patchPythonPath } from "./system-requirements.js"; async function runPython3(...args: string[]) { const command = await patchPythonPath(["python", ...args], { - version: ">=3.9", + version: ">=3.10", environmentVariable: "AUTOREST_PYTHON_EXE", }); const [cmd, ...cmdArgs] = command; From c07711717fee66e4a922b4b082a099a8dfa08c92 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Mon, 27 Apr 2026 15:44:53 +0800 Subject: [PATCH 3/3] Apply suggestion from @msyyc --- .chronus/changes/python-drop-py39-2026-04-27-06-52-15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md b/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md index 6e27fb56f2..3c4bd43661 100644 --- a/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md +++ b/.chronus/changes/python-drop-py39-2026-04-27-06-52-15.md @@ -1,5 +1,5 @@ --- -changeKind: breaking +changeKind: deprecation packages: - "@azure-tools/typespec-python" ---