Skip to content

Commit 3ab82c8

Browse files
authored
Merge branch 'Azure:main' into main
2 parents fba8c3c + 5231877 commit 3ab82c8

File tree

538 files changed

+103301
-15096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

538 files changed

+103301
-15096
lines changed

.github/CODEOWNERS

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
# ServiceOwners: @albertofori @avanigupta @mrm9084
6868

6969
# PRLabel: %App Configuration
70-
/sdk/appconfiguration/ @albertofori @avanigupta @mrm9084 @rossgrambo @xiangyan99
70+
/sdk/appconfiguration/ @albertofori @avanigupta @mrm9084 @rossgrambo @xiangyan99 @jimmyca15
7171

7272
# ServiceLabel: %Attestation
7373
# PRLabel: %Attestation
@@ -389,19 +389,22 @@
389389
# PRLabel: %Health Deidentification
390390
/sdk/healthdataaiservices/ @alexathomases @Azure/healthdatadeidentification
391391

392-
# AzureSdkOwners: @yungshinlintw @vkurpad
392+
# AzureSdkOwners: @yungshinlintw @bojunehsu
393393
# ServiceLabel: %Cognitive - Form Recognizer
394-
# ServiceOwners: @yungshinlintw @vkurpad
394+
# ServiceOwners: @yungshinlintw @bojunehsu
395395

396396
# PRLabel: %Cognitive - Form Recognizer
397-
/sdk/formrecognizer/ @yungshinlintw @vkurpad
397+
/sdk/formrecognizer/ @yungshinlintw @bojunehsu
398398

399-
# AzureSdkOwners: @yungshinlintw @vkurpad
399+
# AzureSdkOwners: @yungshinlintw @bojunehsu
400400
# ServiceLabel: %Document Intelligence
401-
# ServiceOwners: @yungshinlintw @vkurpad
401+
# ServiceOwners: @yungshinlintw @bojunehsu
402+
403+
# PRLabel: %Cognitive - Content Understanding
404+
/sdk/contentunderstanding/ @yungshinlintw @bojunehsu
402405

403406
# PRLabel: %Document Intelligence
404-
/sdk/documentintelligence/ @yungshinlintw @vkurpad
407+
/sdk/documentintelligence/ @yungshinlintw @bojunehsu
405408

406409
# AzureSdkOwners: @xiangyan99
407410
# ServiceLabel: %Cognitive - Metrics Advisor
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: emitter-package-update
3+
description: Automate bumping typespec-python version in emitter-package.json for the Azure SDK for Python repository. Use this skill when the user wants to update @azure-tools/typespec-python to the latest version, create a PR for the version bump, or manage emitter-package.json updates.
4+
---
5+
6+
# Emitter Package Update
7+
8+
Bump `@azure-tools/typespec-python` to the latest version in `emitter-package.json` and create a PR.
9+
10+
## Prerequisites
11+
12+
Before running this workflow, verify the following tools are installed:
13+
14+
```bash
15+
# Check npm-check-updates
16+
npx npm-check-updates --version
17+
18+
# Check tsp-client
19+
tsp-client --version
20+
21+
# Check GitHub CLI
22+
gh --version
23+
```
24+
25+
If any tool is missing:
26+
- **npm-check-updates**: Install via `npm install -g npm-check-updates`
27+
- **tsp-client**: Install via `npm install -g @azure-tools/typespec-client-generator-cli`
28+
- **GitHub CLI**: Install from https://cli.github.com/ or via `winget install GitHub.cli`
29+
30+
## Workflow
31+
32+
### 1. Prepare Repository
33+
34+
Reset and sync the SDK repo to a clean state:
35+
36+
```bash
37+
git reset HEAD && git checkout . && git clean -fd && git checkout origin/main && git pull origin main
38+
```
39+
40+
### 2. Determine Latest Version
41+
42+
Run npm-check-updates to find the latest `@azure-tools/typespec-python` version:
43+
44+
```bash
45+
npx npm-check-updates --packageFile eng/emitter-package.json
46+
```
47+
48+
Extract the target version from the output (e.g., `0.46.4`).
49+
50+
### 3. Create Feature Branch
51+
52+
```bash
53+
git checkout -b bump-typespec-python-{version}
54+
```
55+
56+
Replace `{version}` with the actual version number (e.g., `bump-typespec-python-0.46.4`).
57+
58+
### 4. Update Dependencies
59+
60+
Apply the version update:
61+
62+
```bash
63+
npx npm-check-updates --packageFile eng/emitter-package.json -u
64+
```
65+
66+
Regenerate the lock file:
67+
68+
```bash
69+
tsp-client generate-lock-file
70+
```
71+
72+
### 5. Commit Changes
73+
74+
```bash
75+
git add eng/emitter-package.json eng/emitter-package-lock.json
76+
git commit -m "bump typespec-python {version}"
77+
```
78+
79+
### 6. Create Pull Request
80+
81+
Push branch and create PR:
82+
83+
```bash
84+
git push -u origin bump-typespec-python-{version}
85+
gh pr create --title "bump typespec-python {version}" --body "Bump @azure-tools/typespec-python to version {version}"
86+
```

common/smoketest/dependencies.py

Lines changed: 65 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import argparse
2-
import pkg_resources
2+
3+
import importlib.metadata as importlib_metadata
4+
5+
from packaging.requirements import Requirement
36

47
try:
58
# pip < 20
@@ -10,44 +13,89 @@
1013
from pip._internal.req import parse_requirements
1114
from pip._internal.network.session import PipSession
1215

16+
1317
def combine_requirements(requirements):
14-
name = requirements[0].project_name
18+
name = requirements[0].name # packaging.requirements.Requirement uses 'name' instead of 'project_name'
1519
specs = []
1620
for req in requirements:
17-
if len(req.specs) == 0:
21+
if len(req.specifier) == 0: # packaging.requirements.Requirement uses 'specifier' instead of 'specs'
1822
continue
1923

20-
specs.extend([s[0] + s[1] for s in req.specs])
24+
# Convert specifier to the expected format
25+
specs.extend([str(spec) for spec in req.specifier])
2126

2227
return name + ",".join(specs)
2328

29+
2430
def get_dependencies(packages):
2531
requirements = []
2632
for package in packages:
27-
package_info = pkg_resources.working_set.by_key[package]
33+
try:
34+
# Get the distribution for this package
35+
package_info = importlib_metadata.distribution(package)
2836

29-
applicable_requirements = [r for r in package_info.requires() if r.marker is None or r.marker.evaluate()]
30-
requirements.extend(applicable_requirements)
37+
# Get requirements and process them like pkg_resources did
38+
if package_info.requires:
39+
for req_str in package_info.requires:
40+
# Parse the requirement string
41+
req = Requirement(req_str)
42+
43+
# Apply the same filtering as the original code:
44+
# include requirements where marker is None or evaluates to True
45+
if req.marker is None or req.marker.evaluate():
46+
requirements.append(req)
47+
except importlib_metadata.PackageNotFoundError:
48+
# Package not found, skip it (similar to how pkg_resources would handle missing packages)
49+
continue
50+
except Exception:
51+
# Skip packages that can't be processed
52+
continue
3153

3254
return requirements
3355

56+
3457
if __name__ == "__main__":
35-
parser = argparse.ArgumentParser(
36-
description="List dependencies for a given requirements.txt file"
37-
)
58+
parser = argparse.ArgumentParser(description="List dependencies for a given requirements.txt file")
3859

3960
parser.add_argument(
4061
"-r",
4162
"--requirements",
4263
dest="requirements_file",
4364
help="File containing list of packages for which to find dependencies",
44-
required=True
65+
required=True,
4566
)
4667

4768
args = parser.parse_args()
4869
# Get package names from requirements.txt
4970
requirements = parse_requirements(args.requirements_file, session=PipSession())
50-
package_names = [item.req.name for item in requirements]
71+
72+
# Handle different pip versions - extract package names
73+
package_names = []
74+
for item in requirements:
75+
if hasattr(item, "requirement"):
76+
# Parse the requirement string to get the name
77+
req_str = item.requirement
78+
if isinstance(req_str, str):
79+
# Parse the requirement string using packaging.requirements
80+
try:
81+
req = Requirement(req_str)
82+
package_names.append(req.name)
83+
except Exception:
84+
# If parsing fails, try to extract name directly
85+
name = req_str.split("==")[0].split(">=")[0].split("<=")[0].split(">")[0].split("<")[0].strip()
86+
package_names.append(name)
87+
else:
88+
package_names.append(req_str.name)
89+
elif hasattr(item, "req"):
90+
# Older pip versions
91+
package_names.append(item.req.name)
92+
else:
93+
# Try to get name from the object directly
94+
try:
95+
package_names.append(item.name)
96+
except AttributeError:
97+
# Skip items we can't parse
98+
continue
5199

52100
dependencies = get_dependencies(package_names)
53101

@@ -61,10 +109,12 @@ def get_dependencies(packages):
61109
# According to https://packaging.python.org/glossary/#term-requirement-specifier
62110
grouped_dependencies = {}
63111
for dep in dependencies:
64-
if dep.key in grouped_dependencies:
65-
grouped_dependencies[dep.key].append(dep)
112+
# Use 'name' instead of 'key' for packaging.requirements.Requirement
113+
dep_name = dep.name
114+
if dep_name in grouped_dependencies:
115+
grouped_dependencies[dep_name].append(dep)
66116
else:
67-
grouped_dependencies[dep.key] = [dep]
117+
grouped_dependencies[dep_name] = [dep]
68118

69119
final_dependencies = [combine_requirements(r) for r in grouped_dependencies.values()]
70120

conda/conda-recipes/azure-ai-contentsafety/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -26,7 +25,6 @@ requirements:
2625
run:
2726
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2827
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
29-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3028
- python
3129
- six
3230
- requests-oauthlib >=0.5.0

conda/conda-recipes/azure-ai-evaluation/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -28,7 +27,6 @@ requirements:
2827
run:
2928
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3029
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
31-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3230
- python
3331
- six
3432
- requests-oauthlib >=0.5.0

conda/conda-recipes/azure-ai-formrecognizer/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -26,7 +25,6 @@ requirements:
2625
run:
2726
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2827
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
29-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3028
- python
3129
- six
3230
- requests-oauthlib >=0.5.0

conda/conda-recipes/azure-ai-language-conversations/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -26,7 +25,6 @@ requirements:
2625
run:
2726
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2827
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
29-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3028
- python
3129
- six
3230
- requests-oauthlib >=0.5.0

conda/conda-recipes/azure-ai-language-questionanswering/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -26,7 +25,6 @@ requirements:
2625
run:
2726
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2827
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
29-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3028
- python
3129
- six
3230
- requests-oauthlib >=0.5.0

conda/conda-recipes/azure-ai-ml/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- aiohttp
2120
- azure-storage >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2221
- colorama <=0.4.4
@@ -37,7 +36,6 @@ requirements:
3736
run:
3837
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3938
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
40-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
4139
- aiohttp
4240
- azure-storage >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
4341
- colorama <=0.4.4

conda/conda-recipes/azure-ai-textanalytics/meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ requirements:
1616
host:
1717
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
1818
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
19-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2019
- pip
2120
- python
2221
- six
@@ -26,7 +25,6 @@ requirements:
2625
run:
2726
- azure-core >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
2827
- azure-identity >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
29-
- msrest >={{ environ.get('AZURESDK_CONDA_VERSION', '0.0.0') }}
3028
- python
3129
- six
3230
- requests-oauthlib >=0.5.0

0 commit comments

Comments
 (0)