Skip to content

Commit be7fd51

Browse files
committed
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python into mepatil/apiv2.1DNRPython
2 parents bb60d72 + 125fa85 commit be7fd51

File tree

3,764 files changed

+568122
-38120
lines changed

Some content is hidden

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

3,764 files changed

+568122
-38120
lines changed

.github/CODEOWNERS

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
# /scripts/
1515
# /tools/
1616

17-
################
18-
# Automation
19-
################
20-
21-
# Git Hub integration and bot rules
22-
/.github/ @jsquire @ronniegeraghty
23-
2417
###########
2518
# SDK
2619
###########
@@ -172,6 +165,7 @@
172165
/sdk/eventgrid/ @lmazuel @l0lawrence
173166

174167
# PRLabel: %Image Analysis
168+
# ServiceLabel: %Image Analysis %Service Attention
175169
/sdk/vision/azure-ai-vision-imageanalysis/ @dargilco @rhurey
176170

177171
# PRLabel: %HDInsight
@@ -235,30 +229,30 @@
235229
/sdk/ml/pipeline.tests.yml @wangchao1230 @eniac871
236230

237231
# PRLabel: %ML-RegistryManagement
238-
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/ @hugoaponte @Man-MSFT @banibrata
239-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @hugoaponte @Man-MSFT @banibrata
240-
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/ @hugoaponte @Man-MSFT @banibrata
232+
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/registry/ @hugoaponte @Man-MSFT
233+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @hugoaponte @Man-MSFT
234+
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/ @hugoaponte @Man-MSFT
241235

242236
# PRLabel: %ML-Assets
243-
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/ @hugoaponte @Man-MSFT @banibrata
244-
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/ @hugoaponte @Man-MSFT @banibrata
245-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @hugoaponte @Man-MSFT @banibrata
246-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @hugoaponte @Man-MSFT @banibrata
247-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @hugoaponte @Man-MSFT @banibrata
248-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @hugoaponte @Man-MSFT @banibrata
249-
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/ @hugoaponte @Man-MSFT @banibrata
250-
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/ @hugoaponte @Man-MSFT @banibrata
251-
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/ @hugoaponte @Man-MSFT @banibrata
252-
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/ @hugoaponte @Man-MSFT @banibrata
237+
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/component/ @hugoaponte @Man-MSFT
238+
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_component/ @hugoaponte @Man-MSFT
239+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_code_operations.py @hugoaponte @Man-MSFT
240+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_component_operations.py @hugoaponte @Man-MSFT
241+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_environment_operations.py @hugoaponte @Man-MSFT
242+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py @hugoaponte @Man-MSFT
243+
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/ @hugoaponte @Man-MSFT
244+
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/ @hugoaponte @Man-MSFT
245+
/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/ @hugoaponte @Man-MSFT
246+
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/assets/ @hugoaponte @Man-MSFT
253247

254248
# PRLabel: %ML-Inference
255-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
256-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
257-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
258-
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
259-
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/ @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
260-
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/ @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
261-
/sdk/ml/production-experiences.tests.yml @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft @banibrata
249+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_deployment_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
250+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
251+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_deployment_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
252+
/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_online_endpoint_operations.py @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
253+
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/ @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
254+
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_endpoint/ @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
255+
/sdk/ml/production-experiences.tests.yml @hugoaponte @Man-MSFT @nancy-mejia @TajiHarrisMicrosoft
262256

263257
# PRLabel: %ML-Workspace
264258
/sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/ @mingweihe @seanyao1
@@ -283,7 +277,7 @@
283277
/sdk/mixedreality/azure-mixedreality-authentication/ @RamonArguelles
284278
/sdk/remoterendering/ @FlorianBorn71
285279

286-
# PRLabel: %Open AI
280+
# PRLabel: %OpenAI
287281
/sdk/openai/ @kristapratico @glecaros
288282

289283
# PRLabel: %Purview
@@ -603,7 +597,7 @@
603597
#/<NotInRepo>/ @jfggdl
604598

605599
# ServiceLabel: %Event Hubs %Service Attention
606-
#/<NotInRepo>/ @kasun04 @saglodha
600+
#/<NotInRepo>/ @kasun04
607601

608602
# ServiceLabel: %Functions %Service Attention
609603
#/<NotInRepo>/ @ahmedelnably @fabiocav
@@ -620,9 +614,6 @@
620614
# ServiceLabel: %HPC Cache %Service Attention
621615
#/<NotInRepo>/ @romahamu @omzevall
622616

623-
# ServiceLabel: %Image Analysis %Service Attention
624-
/sdk/vision/azure-ai-vision-imageanalysis/ @dargilco @rhurey
625-
626617
# ServiceLabel: %Import Export %Service Attention
627618
#/<NotInRepo>/ @madhurinms
628619

@@ -783,7 +774,7 @@
783774
#/<NotInRepo>/ @chlahav
784775

785776
# ServiceLabel: %Service Attention %Service Bus
786-
#/<NotInRepo>/ @saglodha @EldertGrootenboer
777+
#/<NotInRepo>/ @EldertGrootenboer
787778

788779
# ServiceLabel: %Service Attention %Service Fabric
789780
#/<NotInRepo>/ @QingChenmsft @vaishnavk @juhacket

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Python cache
55
__pycache__/
6-
*.pyc
6+
*.py[cod]
77
.pytest_cache
88
.mypy_cache
99
.cache

.vscode/cspell.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"sdk/translation/azure-ai-translation-document/samples/assets/**",
9191
"sdk/translation/azure-ai-translation-document/tests/glossaries-valid.csv",
9292
"sdk/storage/azure-storage-blob/**",
93+
"sdk/storage/azure-storage-extensions/**",
9394
"sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/**",
9495
"sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_virtual_cluster_utils/_restclient/**",
9596
"sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_name_generator.py",
@@ -98,6 +99,8 @@
9899
"sdk/ml/azure-ai-ml/swagger/**",
99100
"sdk/ml/azure-ai-ml/NOTICE.txt",
100101
"sdk/ml/azure-ai-ml/.pre-commit-config.yaml",
102+
"sdk/monitor/azure-monitor-opentelemetry/samples/tracing/django/sample/db.sqlite3",
103+
"sdk/monitor/azure-monitor-opentelemetry-exporter/samples/traces/django/sample/db.sqlite3",
101104
"sdk/loadtestservice/azure-developer-loadtesting/**",
102105
"sdk/translation/azure-ai-translation-text/azure/ai/translation/text/_serialization.py",
103106
"sdk/translation/azure-ai-translation-text/tests/test_break_sentence.py",
@@ -547,6 +550,13 @@
547550
"Jwcmlud"
548551
]
549552
},
553+
{
554+
"filename": "sdk/identity/test-resources*",
555+
"words": [
556+
"kubelet",
557+
"otsv"
558+
]
559+
},
550560
{
551561
"filename": "sdk/identity/azure-identity/TROUBLESHOOTING.md",
552562
"words": [
@@ -792,7 +802,12 @@
792802
"racwd",
793803
"rrggbb",
794804
"UPCA",
795-
"UPCE"
805+
"UPCE",
806+
"mros",
807+
"Nify",
808+
"deserializers",
809+
"ctxt",
810+
"wday"
796811
]
797812
},
798813
{
@@ -1241,6 +1256,13 @@
12411256
"smirnov"
12421257
]
12431258
},
1259+
{
1260+
"filename": "sdk/ai/azure-ai-generative/**",
1261+
"words": [
1262+
"tqdm",
1263+
"genai"
1264+
]
1265+
},
12441266
{
12451267
"filename": "sdk/attestation/azure-security-attestation/tests/conftest.py",
12461268
"words":[

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Management libraries can be identified by namespaces that start with `azure-mgmt
5353
## Need help?
5454

5555
* For detailed documentation visit our [Azure SDK for Python documentation](https://aka.ms/python-docs)
56-
* File an issue via [Github Issues](https://github.com/Azure/azure-sdk-for-python/issues)
56+
* File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-python/issues)
5757
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+python) or ask new ones on StackOverflow using `azure` and `python` tags.
5858

5959
### Community

doc/dev/docstring.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ A method docstring is annotated by the Python long-string `"""<docstring>"""` ri
2222
2323
The request must include a `training_files_url` parameter that is an
2424
externally accessible Azure storage blob container URI (preferably a Shared Access Signature URI). Note that
25-
a container URI (without SAS) is accepted only when the container is public.
25+
a container URI (without SAS) is accepted only when the container is public.
26+
See `SAS container details
27+
<https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set>`__
28+
for more details.
2629
Models are trained using documents that are of the following content type - 'application/pdf',
2730
'image/jpeg', 'image/png', 'image/tiff', or 'image/bmp'. Other types of content in the container is ignored.
2831
@@ -63,7 +66,7 @@ A method docstring is annotated by the Python long-string `"""<docstring>"""` ri
6366
...
6467
```
6568

66-
The first portion of this docstring is a general description of what the method does. Following the general description of the method is a **required new line** and then documentation for each of the parameters, optional keyword arguments, returned objects, and potentially raised errors.
69+
The first portion of this docstring is a general description of what the method does. It contains a clickable link to MS documentation (note the special format and double-underscore necessary to make this work). Following the general description of the method is a **required new line** and then documentation for each of the parameters, optional keyword arguments, returned objects, and potentially raised errors.
6770

6871
Positional parameters can be documented in one-line or two-lines. Both options can be used in a single docstring for documenting different parameters without issue.
6972
1. This option works best for parameters that are one of the basic types (`str`, `int`, `bool`, `bytes`, `float`, etc.)

doc/dev/tests.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ Live Azure resources will be necessary in order to run live tests and produce re
181181
resource management commands, documented in [/eng/common/TestResources][test_resources], that streamline this process.
182182
Both pure ARM templates (`test-resources.json`) and BICEP files (`test-resources.bicep`) are supported.
183183

184+
User-based authentication is preferred when using test resources. To enable this:
185+
- Use the [`-UserAuth` command flag][user_auth_flag] when running the `New-TestResources` script.
186+
- Set the environment variable `AZURE_TEST_USE_PWSH_AUTH` to "true" to authenticate with Azure PowerShell, or
187+
`AZURE_TEST_USE_CLI_AUTH` to "true" to authenticate with Azure CLI.
188+
- Ensure you're logged into the tool you choose -- if
189+
you used `New-TestResources.ps1` to deploy resources, you'll already have logged in with Azure PowerShell.
190+
184191
If you haven't yet set up a `test-resources` file for test resource deployment and/or want to use test resources of
185192
your own, you can just configure credentials to target these resources instead.
186193

@@ -209,14 +216,20 @@ environment variables necessary to run live tests for the service. After storing
209216
-- formatted as `VARIABLE=value` on separate lines -- your credentials and test configuration variables will be set in
210217
our environment when running tests.
211218

219+
If you used the [`-UserAuth` command flag][user_auth_flag] to deploy test resources, set either
220+
`AZURE_TEST_USE_PWSH_AUTH` or `AZURE_TEST_USE_CLI_AUTH` to "true" to authenticate with Azure PowerShell or Azure CLI,
221+
respectively. If both are set to true, Azure PowerShell will be used.
222+
212223
If your service doesn't have a `test-resources` file for test deployment, you'll need to set environment variables
213-
for `AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and `AZURE_CLIENT_SECRET` at minimum.
224+
for authentication at minimum. For user-based authentication, use `AZURE_TEST_USE_PWSH_AUTH` or
225+
`AZURE_TEST_USE_CLI_AUTH` as described above.
214226

227+
For service principal authentication:
215228
1. Set the `AZURE_SUBSCRIPTION_ID` variable to your organization's subscription ID. You can find it in the "Overview"
216229
section of the "Subscriptions" blade in the [Azure Portal][azure_portal].
217230
2. Define the `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and `AZURE_CLIENT_SECRET` of a test service principal. If you do not
218-
have a service principal, use the Azure CLI's [az ad sp create-for-rbac][azure_cli_service_principal] command (ideally,
219-
using your alias as the service principal's name prefix):
231+
have a service principal, use the Azure CLI's [az ad sp create-for-rbac][azure_cli_service_principal] command
232+
(ideally, using your alias as the service principal's name prefix):
220233

221234
```
222235
az login
@@ -326,7 +339,9 @@ well. To run tests in playback, either set `AZURE_TEST_RUN_LIVE` to "false" or l
326339

327340
### Run and record tests
328341

329-
With the `AZURE_TEST_RUN_LIVE` environment variable set to "true", use `pytest` to run your test(s) in live mode.
342+
First, refer to the [Configure test variables](#configure-test-variables) section to ensure environment variables are
343+
set for test resources and authentication. With the `AZURE_TEST_RUN_LIVE` environment variable set to "true", use
344+
`pytest` to run your test(s) in live mode.
330345

331346
```
332347
(env) azure-sdk-for-python\sdk\my-service\my-package> pytest tests
@@ -339,18 +354,18 @@ Playback test errors most frequently indicate a need for additional sanitizers a
339354
[Sanitize secrets](#sanitize-secrets)). If you encounter any unexpected errors, refer to the
340355
[test proxy troubleshooting guide][troubleshooting_guide].
341356

342-
At this point there should folder called `recordings` inside your package's `tests` directory. Each recording in this
343-
folder will be a `.json` file that captures the HTTP traffic that was generated while running the test matching the
344-
file's name.
357+
If tests were recorded for a new library, there should now be a folder called `recordings` inside your package's
358+
`tests` directory. Each recording in this folder will be a `.json` file that captures the HTTP traffic that was
359+
generated while running the test matching the file's name.
345360

346361
The final step in setting up recordings is to move these files out of the `azure-sdk-for-python` and into the
347362
`azure-sdk-assets` repository. The [recording migration guide][recording_move] describes how to do so. This step only
348-
needs to be completed once. Your library will have an `assets.json` file at its root, which stores the `azure-sdk-assets`
349-
tag that contains the current set of recordings.
363+
needs to be completed once. Your library will have an `assets.json` file at its root, which stores the
364+
`azure-sdk-assets` tag that contains the current set of recordings.
350365

351-
From this point on, recordings will automatically be fetched when tests are run in playback mode -- either from
352-
a local cache (described in [Update test recordings](#update-test-recordings)), or from `azure-sdk-assets` if they're
353-
not locally available.
366+
From this point on, recordings will automatically be fetched when tests are run in playback mode -- either from a local
367+
cache (described in [Update test recordings](#update-test-recordings)), or from `azure-sdk-assets` if they're not
368+
locally available.
354369

355370
#### Update test recordings
356371

@@ -725,3 +740,4 @@ Tests that use the Shared Access Signature (SAS) to authenticate a client should
725740
[test_proxy_startup]: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/test_proxy_migration_guide.md#start-the-proxy-server
726741
[test_resources]: https://github.com/Azure/azure-sdk-for-python/tree/main/eng/common/TestResources#readme
727742
[troubleshooting_guide]: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/test_proxy_troubleshooting.md
743+
[user_auth_flag]: https://github.com/Azure/azure-sdk-for-python/blob/main/eng/common/TestResources/New-TestResources.ps1.md#-userauth

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ omitted_paths:
1414
- sdk/**/swagger/*
1515
- sdk/ml/azure-ai-ml/tests/*
1616
- sdk/vision/azure-ai-vision-imageanalysis/tests/*
17+
- sdk/storage/azure-storage-extensions/*
1718

1819
language: python
1920
root_check_enabled: True

0 commit comments

Comments
 (0)