Skip to content
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: fix
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fix enum member names with hyphens generating invalid Python identifiers
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Add apiview and sphinx to ci
9 changes: 9 additions & 0 deletions .chronus/changes/python-drop-39-2026-4-27-6-50-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: deprecation
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Drop support for Python 3.9. The minimum supported Python version is now 3.10. Python 3.9 reached end-of-life and is no longer supported by upstream Python.
8 changes: 8 additions & 0 deletions .chronus/changes/python-fixCI-2026-3-24-14-53-10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fix failing CI
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

Fix transient mypy CI failures on Windows with retry logic and update CONTRIBUTING docs to reflect the new end-to-end release workflow
7 changes: 7 additions & 0 deletions .chronus/changes/sync-structure-change-2026-3-28-15-45-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-python"
---

sync eng change from upstream emitter
60 changes: 58 additions & 2 deletions eng/scripts/sync_from_typespec.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
TYPESPEC_TEST_DIR = Path("packages/http-client-python/tests")
AUTOREST_TEST_DIR = Path("packages/typespec-python/tests")

TYPESPEC_DEV_REQUIREMENTS = Path("packages/http-client-python/eng/scripts/ci/dev_requirements.txt")
AUTOREST_DEV_REQUIREMENTS = Path("packages/typespec-python/dev_requirements.txt")

# Marker indicating where repo-specific content begins in dev_requirements.txt.
# Everything from this line onward in the autorest file is preserved; everything
# above is replaced with the upstream content (prefixed by a header comment).
_DEV_REQUIREMENTS_HEADER = "# shall keep aligned with dev_requirements.txt of @typespec/http-client-python"
_DEV_REQUIREMENTS_TAIL_MARKER = "# additional dependency needed for development"

# --- Marker patterns for requirements sync ---
#
# Convention in requirements files (e.g. azure.txt, unbranded.txt):
Expand Down Expand Up @@ -154,6 +163,46 @@ def sync_requirements(source_dir: Path, target_dir: Path) -> None:
print(f" Copied: requirements/{filename}")


# ---------------------------------------------------------------------------
# dev_requirements.txt sync
# ---------------------------------------------------------------------------


def sync_dev_requirements(source_file: Path, target_file: Path) -> None:
"""Sync upstream dev_requirements.txt, preserving repo-specific tail.

The target file layout is:
<header>
<upstream content>

# additional dependency needed for development
<repo-specific deps> <-- preserved from existing target

Content from the tail marker onward in the existing target is kept;
everything above is replaced with header + upstream.
"""
if not source_file.is_file():
print(f" WARNING: {source_file} not found, skipping")
return

upstream = source_file.read_text(encoding="utf-8").strip()

tail = ""
if target_file.is_file():
existing = target_file.read_text(encoding="utf-8")
idx = existing.find(_DEV_REQUIREMENTS_TAIL_MARKER)
if idx >= 0:
tail = existing[idx:].strip()

content = f"{_DEV_REQUIREMENTS_HEADER}\n{upstream}\n"
if tail:
content += f"\n{tail}\n"

target_file.parent.mkdir(parents=True, exist_ok=True)
target_file.write_text(content, encoding="utf-8", newline="\n")
print(f" Synced: {target_file.name}")


# ---------------------------------------------------------------------------
# Test file sync
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -246,14 +295,21 @@ def main() -> int:
autorest_repo / AUTOREST_TEST_DIR / "requirements",
)

# 3. Sync test files
# 3. Sync dev_requirements.txt
print("Syncing dev_requirements.txt...")
sync_dev_requirements(
typespec_repo / TYPESPEC_DEV_REQUIREMENTS,
autorest_repo / AUTOREST_DEV_REQUIREMENTS,
)

# 4. Sync test files
print("Syncing test files...")
sync_test_files(
typespec_repo / TYPESPEC_TEST_DIR,
autorest_repo / AUTOREST_TEST_DIR,
)

# 4. Format TypeScript files
# 5. Format TypeScript files
ts_python_dir = autorest_repo / "packages" / "typespec-python"
print("Running pnpm format...")
result = subprocess.run(
Expand Down
1 change: 0 additions & 1 deletion packages/autorest.python/autorest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from pygen import ReaderAndWriter, Plugin, YamlUpdatePlugin, OptionsDict
from .jsonrpc import AutorestAPI


_LOGGER = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion packages/autorest.python/autorest/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from .jsonrpc import AutorestAPI
from . import PluginAutorest


_LOGGER = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion packages/autorest.python/autorest/jsonrpc/localapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from . import AutorestAPI, Channel


_LOGGER = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion packages/autorest.python/autorest/jsonrpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from .stdstream import read_message, write_message


_LOGGER = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion packages/autorest.python/autorest/jsonrpc/stdstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from . import AutorestAPI, Channel


_LOGGER = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion packages/autorest.python/autorest/m2r.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# license information.
# --------------------------------------------------------------------------
"""An autorest MD to RST plugin."""

import logging
from typing import Any, Dict, Set, Union

Expand All @@ -12,7 +13,6 @@

from . import YamlUpdatePluginAutorest


_LOGGER = logging.getLogger(__name__)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# license information.
# --------------------------------------------------------------------------
"""The modelerfour reformatter autorest plugin."""

import re
import copy
import logging
Expand All @@ -19,7 +20,6 @@
)
from .. import YamlUpdatePluginAutorest


ORIGINAL_ID_TO_UPDATED_TYPE: Dict[int, Dict[str, Any]] = {}
OAUTH_TYPE = "OAuth2"
KEY_TYPE = "Key"
Expand Down
1 change: 1 addition & 0 deletions packages/autorest.python/autorest/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# license information.
# --------------------------------------------------------------------------
"""The preprocessing autorest plugin."""

from typing import Dict, Any
from pygen.preprocess import PreProcessPlugin
from . import YamlUpdatePluginAutorest
Expand Down
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjE3ODYzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNjIxODExMC9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.28.3.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "^4.21.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# --------------------------------------------------------------------------

from copy import deepcopy
import sys
from typing import Any, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -21,6 +21,11 @@
from ._utils.serialization import Deserializer, Serializer
from .operations import HttpSuccessOperations, Operations, SelfDefineOperations

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # type: ignore

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
import xml.etree.ElementTree as ET

import isodate # type: ignore
from typing_extensions import Self

from azure.core.exceptions import DeserializationError, SerializationError
from azure.core.serialization import NULL as CoreNull

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")

JSON = MutableMapping[str, Any]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# --------------------------------------------------------------------------

from copy import deepcopy
import sys
from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
Expand All @@ -21,6 +21,11 @@
from ._configuration import PyprojectMgmtClientConfiguration
from .operations import HttpSuccessOperations, Operations, SelfDefineOperations

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # type: ignore

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials_async import AsyncTokenCredential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["azure", "azure sdk"]

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# --------------------------------------------------------------------------

from copy import deepcopy
import sys
from typing import Any, Optional, TYPE_CHECKING, cast
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -21,6 +21,11 @@
from ._utils.serialization import Deserializer, Serializer
from .operations import HttpSuccessOperations

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # type: ignore

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import List

__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
import xml.etree.ElementTree as ET

import isodate # type: ignore
from typing_extensions import Self

from azure.core.exceptions import DeserializationError, SerializationError
from azure.core.serialization import NULL as CoreNull

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

_BOM = codecs.BOM_UTF8.decode(encoding="utf-8")

JSON = MutableMapping[str, Any]
Expand Down
Loading
Loading