Skip to content

Commit 1965adc

Browse files
authored
Merge pull request #40 from ChenxiJiang333/update-qas
update qas
2 parents 2f20cdd + fe0a244 commit 1965adc

File tree

8 files changed

+472
-0
lines changed

8 files changed

+472
-0
lines changed

QA/for_ci/test-cases-for-python.md

Lines changed: 182 additions & 0 deletions
Large diffs are not rendered by default.

QA/python_2025_10_17.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Problem releasing remoterendering SDK for deprecation
2+
3+
## question
4+
Hi,
5+
I'm trying to release the remoterendering SDK with the deprecation notice according to Step 4 in [azure-sdk-for-python/doc/deprecation_process.md at main · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/deprecation_process.md).
6+
7+
I did all the merging and executed the `Prepare-Release.ps1step` described in the guide, but then I tried to follow [Run release SDK pipeline](https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-pipeline) to actually release the package and I ran into problems.
8+
9+
The output of the `python - remoterendering` pipeline [here](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5452798&view=results) does not look at all like the output described on the guide page for the release. I don't see any `package-signed` artifacts or any review step I could do.
10+
11+
I see that the `Integration` step in the pipeline is skipping quiet a lot of things, but I don't know how to convince it to do more.
12+
13+
Any help?
14+
15+
The content of ci.yml contains this:
16+
```
17+
extends:
18+
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
19+
parameters:
20+
ServiceDirectory: remoterendering
21+
TestProxy: true
22+
Artifacts:
23+
- name: azure-mixedreality-remoterendering
24+
safeName: azuremixedrealityremoterendering
25+
```
26+
27+
## answer
28+
Your manually queued build here: [Pipelines - Run 20251015.1](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5459981&view=results)
29+
30+
DOES reflect the stages you're expecting. The link you linked to above is the individual CI which runs automatically when a merge happens in that folder to `main`. They both have identical `SHA` ref, so you should be clear to release the deprecation now from your manually queued build.

QA/python_2025_10_24.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Python sdk release
2+
3+
## question
4+
Hu team , I am trying to release python sdk for oracle databse however build keep failing . Please help mitigate the issue , here is the link to the pipeline https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5453800&view=results.
5+
6+
## answer
7+
Two options.
8+
9+
1. Regenerate your package using the `emitter-package.json` that's in `main`. Submit that PR.
10+
Submit a targeted PR that changes the `pyproject.toml` for your package to exclude the directories that shouldn't be there. Here is a PR generated from the newer emitter package. https://github.com/Azure/azure-sdk-for-python/pull/43272/files#r2430170753
11+
2. You could manually update your `pyproject.toml` to align with what you see in this PR. That's also an option.

QA/python_2025_10_31.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Ubunty 2303 pypy39 specific failure
2+
3+
## question
4+
Hi,
5+
6+
I am seeing this error in the pipeline. Can anyone check please?
7+
```
8+
--- stderr
9+
error: the configured PyPy interpreter version (3.9) is lower than
10+
PyO3's minimum supported version (3.11)
11+
warning: build failed, waiting for other jobs to finish...
12+
```
13+
[Pipelines - Run 20251030.12 logs](https://dev.azure.com/azure-sdk/public/_build/results?buildId=5517166&view=logs&j=98792cce-2755-554b-a8ad-f8c76be41d33&t=7feb2094-2399-5589-4545-1b2ca3b7ddc8)
14+
15+
## answer
16+
You have a dependency that doesn't ship a pypy39 dep. That's all. You could swap that with pypy311 in your matrix if you wanted to give it a shot.

QA/python_2025_11_07.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# NOTICE.txt updates
2+
3+
## question
4+
Are there any recommendations to update the NOTICE.txt file in the root of the packages?
5+
6+
We have recently received a GH issue [NOTICE calls out gpl-3.0 for non-gpl-3.0 packages · Issue #43717 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/issues/43717) requesting to update the NOTICE.txt in azure-ai-ml package.
7+
8+
We found the general recommendations here [NOTICE generation | Docs - Microsoft Open Source](https://docs.opensource.microsoft.com/tools/cg/legal/notice/). Could someone please help us figure out what is the right approach to update the NOTICE.txt?
9+
10+
## answer
11+
Attaching the links shared by Justin:
12+
1. [Attribution guidelines | Docs - Microsoft Open Source](https://docs.opensource.microsoft.com/legal/cela-guidance/attribution-guidelines/)
13+
2. [NOTICE FAQ | Docs - Microsoft Open Source](https://docs.opensource.microsoft.com/using/guidance-for-open-source-usage/notice-faq/#q-when-do-i-need-a-notice)
14+
3. [NOTICE FAQ | Docs - Microsoft Open Source](https://docs.opensource.microsoft.com/using/guidance-for-open-source-usage/notice-faq/#q-does-cela-need-to-review-the-notice)
15+
16+
So it seems we would need a notice if:
17+
- compiled build or any other scenario where the recipient can no longer access or view the code in source code form (attribute the full dependency tree that is distributed).
18+
Since it's Python, we only deliver source files in Python. This SDK does not even include native code in C/C++.
19+
- source code repository (attribute open source copied into the repo; not referenced dependencies).
20+
This SDK doesn't copy/paste OSS code from 3P offering.
21+
22+
The SDK package we put on PyPI doesn't contain any source file that is copied from any other OSS components. So my understanding is that we don't need a NOTICE.
23+
24+
# Python emitter issue with bulleted list TypeSpec doc string, and other
25+
26+
## question
27+
This TypeSpec repo/branch/folder: https://github.com/Azure/azure-rest-api-specs-pr/tree/feature/ai-foundry/agents-v2/specification/ai/Azure.AI.Projects
28+
29+
Is emitted into this Python repo/branch/folder: https://github.com/Azure/azure-sdk-for-python/tree/feature/azure-ai-projects/2.0.0b1/sdk/ai/azure-ai-projects
30+
31+
Using the command `tsp-client update --debug --local-spec-repo <path>`
32+
33+
I have a green build, other than errors in the "Build Docs" stage, as seen in this build of the branc: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5527867&view=results
34+
35+
I need some guidance on how to update TypeSpec to make these Python doc generation go away.
36+
37+
The errors are the following:
38+
39+
```
40+
updating environment: [new config] 7 added, 0 changed, 0 removed
41+
docstring of azure.ai.projects.models.Reasoning.generate_summary:6: WARNING: Inline strong start-string without end-string. [docutils]
42+
docstring of azure.ai.projects.models.WorkflowDefinition.workflow:2: WARNING: Duplicate explicit target name: "learn more". [docutils]
43+
docstring of azure.ai.projects.models.WorkflowDefinition.workflow:2: WARNING: Duplicate explicit target name: "learn more". [docutils]
44+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:54: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
45+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:61: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
46+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:64: ERROR: Unexpected indentation. [docutils]
47+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:65: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
48+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:67: ERROR: Unexpected indentation. [docutils]
49+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:79: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
50+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:82: ERROR: Unexpected indentation. [docutils]
51+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:83: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
52+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:89: ERROR: Unexpected indentation. [docutils]
53+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:90: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
54+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:109: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
55+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._models.Response:112: ERROR: Unexpected indentation. [docutils]
56+
docstring of azure.ai.projects.models.WorkflowDefinition.workflow:2: WARNING: Duplicate explicit target name: "learn more". [docutils]
57+
docstring of azure.ai.projects.models.Response.output:10: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
58+
docstring of azure.ai.projects.models.Response.output:12: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
59+
docstring of azure.ai.projects.models.Response.tools:9: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
60+
docstring of azure.ai.projects.models.Response.tools:12: ERROR: Unexpected indentation. [docutils]
61+
docstring of azure.ai.projects.models.Response.tools:13: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
62+
docstring of azure.ai.projects.models.Response.truncation:8: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
63+
docstring of azure.ai.projects.models.Response.truncation:11: ERROR: Unexpected indentation. [docutils]
64+
docstring of azure.ai.projects.models.Response.truncation:12: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]
65+
docstring of azure.ai.projects.models.WorkflowDefinition.workflow:2: WARNING: Duplicate explicit target name: "learn more". [docutils]
66+
E:\src\sdk-repos\azure-sdk-for-python\sdk\ai\azure-ai-projects\.tox\sphinx\Lib\site-packages\azure\ai\projects\models\__init__.py:docstring of azure.ai.projects.models._enums.ServiceTier:4: WARNING: Bullet list ends without a blank line; unexpected unindent. [docutils]
67+
```
68+
69+
It comes from two TypeSpec models, direct link here:
70+
Response model - https://github.com/Azure/azure-rest-api-specs-pr/blob/feature/ai-foundry/agents-v2/specification/ai/Azure.AI.Projects/.external-readonly/openai.external.typespec/responses/custom.tsp#L38
71+
ServiceTier union - https://github.com/Azure/azure-rest-api-specs-pr/blob/feature/ai-foundry/agents-v2/specification/ai/Azure.AI.Projects/.external-readonly/openai.external.typespec/responses/custom.tsp#L38
72+
73+
## answer
74+
Within the pyproject.toml for the problematic package, disable the sphinx environment is my advice. that way you won't hit these sphinx failures.
75+
76+
```
77+
[tool.azure-sdk-build]
78+
sphinx = false
79+
```

QA/python_2025_11_14.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# When emitting Python from TypeSpec, how do I rename an operation path parameter?
2+
3+
## question
4+
I have this operation defined in TypeSpec. I know I can add the `@clientName` to change the name of the input parameter in the emitted Python operation method. This TypeSpec compiles fine (see [full TypeSpec file here](https://github.com/Azure/azure-rest-api-specs-pr/blob/feature/ai-foundry/agents-v2/specification/ai/Azure.AI.Projects/agents/operations.tsp#L56)):
5+
6+
```
7+
interface Agents {
8+
9+
@post
10+
@route("/agents/{agent_name}")
11+
@tag("Agents")
12+
updateAgent is AgentOperation<
13+
{
14+
@path
15+
@clientName("name", "python")
16+
agent_name: string;
17+
18+
...UpdateAgentRequest;
19+
},
20+
AgentObject
21+
>;
22+
23+
}
24+
```
25+
26+
However I'm trying to avoid adding @clientName decorators in TypeSpec model definitions, and instead have them all in the client.tsp file.
27+
28+
My question: how do I do the above, but using @@clientName in client.tsp file instead? I've tried many things, but no luck. Including:
29+
30+
```
31+
@@clientName(Agents.updateAgent::parameters.agent_name, "name", "python");
32+
```
33+
34+
which files to compile with error `Model doesn't have member agent_name`. In the above case it's not a member but a path, so perhaps that's the reason for the error, but I don't know how to fix it.
35+
36+
## answer
37+
You could define an alias to include path parameters then rename the path parameters by the alias like :
38+
```
39+
40+
alias UpdateAgentParams = {
41+
@path originalName1: string;
42+
};
43+
44+
interface MyOp {
45+
@post
46+
@route("/name/{originalName1}")
47+
updateAgent1 is AgentOperation<
48+
UpdateAgentParams,
49+
void
50+
>;
51+
52+
@post
53+
@route("/name/{originalName2}")
54+
updateAgent2 is AgentOperation<
55+
{
56+
@path originalName2: string;
57+
},
58+
void
59+
>;
60+
}
61+
62+
@@clientName(UpdateAgentParams.originalName1, "newName1"); // OK
63+
64+
// Can't work since Typespec can't refer to parameter defined in an anonymous model in Template
65+
// @clientName(MyOp.updateAgent2::parameters.originalName2, "newName2");
66+
```

QA/python_2025_11_28.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# "black" job in pipeline fails, but when I run locally, the tool does not make any changes
2+
3+
## question
4+
I like to run the "black" tool before PRs, and I ask others in my project to do the same. A few hours ago I found out that I can turn on this check in the pipeline. I was happy to see this. So I added the following to pyproject.toml:
5+
6+
```
7+
[tool.azure-sdk-build]
8+
black = true
9+
```
10+
11+
I run "black" before commiting my last change to the PR, and no updates were needed.
12+
13+
But the pipeline called out a "black" failure: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5606772&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=efe9ac6d-3fdb-50af-24e1-4319f36eecb4
14+
15+
I see the pipeline used black version 24.4.0. I had a newer version when I run locally. I install 24.4.0 and run that, but it also did not do any changes to the code.
16+
17+
Any idea how to fix it? (other than removing it from the pipeline...).
18+
19+
## answer
20+
I tried the same command used by ci: `python -m azpysdk.main black --isolate /mnt/vss/_work/1/s/sdk/ai/azure-ai-projects`, and find that your project has one file reformatted.
21+
22+
NOTE: the command ci uses need some time and I recommend you use one simple command which usually has same effect and much faster: `black sdk/ai/azure-ai-projects/ -l 120`

QA/python_2025_12_12.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Generate docs CI check keeps failing
2+
3+
## question
4+
I’m working on a Python SDK PR and the **generate-docs** CI check continues failing.
5+
The error points to `CreateDeploymentDetails.azure_resource_ids` with:
6+
> “Definition list ends without a blank line; unexpected unindent.”
7+
I’ve already updated the docstring based on this message, but CI still reports the same failure.
8+
Here is the error log: [Pipelines - Run 20251209.42 logs](https://dev.azure.com/azure-sdk/public/public%20Team/_build/results?buildId=5652585&view=logs&j=7b8caaf3-aec7-5f50-aa20-46d4a6342ac3&t=286a7ccb-1111-5827-fc90-5c974fed4202&l=313)
9+
10+
For reference:
11+
- Generated model location: https://github.com/Azure/azure-sdk-for-python/blob/a03b420f1222064b0c332d772ed8955e8ae578d1/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py#L633
12+
- Patched model location: https://github.com/Azure/azure-sdk-for-python/blob/a03b420f1222064b0c332d772ed8955e8ae578d1/sdk/cognitivelanguage/azure-ai-language-conversations-authoring/azure/ai/language/conversations/authoring/models/_models.py#L633
13+
14+
Could you please advise:
15+
1. Is there a recommended way to run the generate-docs step locally so I can verify the fix without pusshing repeatedly?
16+
2. Any guidance on the correct docstring formatting expected here?
17+
18+
## answer
19+
There is an easy way to repro your failures: install `eng/tools/azure-sdk-tools[build]` . then just `azpysdk sphinx .` from your package directory.
20+
21+
# Pytest failure: test fixtures not being recognized
22+
23+
## question
24+
I’m following the Python SDK testing guidance (link: [Dataplane Codegen Quick Start for Test · Azure/azure-sdk-for-python Wiki](https://github.com/Azure/azure-sdk-for-python/wiki/Dataplane-Codegen-Quick-Start-for-Test)), but I’m seeing an issue related to fixtures not being recognized by pytest.
25+
When running the tests, I get the following error: **fixture 'text_analysis_endpoint' not found**.
26+
27+
But I have the environment variables correctly configured in my `.env` , and I have a `conftest.py` file that follows the guidance exactly.
28+
For reference, here is the `conftest.py` I’m using: [azure-sdk-for-python/sdk/cognitivelanguage/azure-ai-textanalytics/tests/conftest.py at dd52517afed9…](https://github.com/Azure/azure-sdk-for-python/blob/dd52517afed9dffae02a0239bb397be091643310/sdk/cognitivelanguage/azure-ai-textanalytics/tests/conftest.py)
29+
```
30+
import pytest
31+
32+
@pytest.fixture(scope="session", autouse=True)
33+
def start_proxy(test_proxy, patch_sleep, patch_async_sleep):
34+
return
35+
```
36+
37+
It seems like the fixtures are not being loaded into the test environment.
38+
Did I miss something in the setup? Any pointers would be greatly appreciated — thank you!
39+
40+
## answer
41+
The issue could resolved by directly defining the endpoint/key fixtures in conftest.py.
42+
```
43+
import pytest
44+
from devtools_testutils import EnvironmentVariableLoader
45+
46+
# Environment variable keys
47+
ENV_ENDPOINT = "TEXT_ANALYSIS_ENDPOINT"
48+
ENV_KEY = "TEXT_ANALYSIS_KEY"
49+
50+
@pytest.fixture(scope="session")
51+
def text_analysis_endpoint(environment_variables: EnvironmentVariableLoader) -> str:
52+
"""Endpoint for Text Analysis tests."""
53+
return environment_variables.get(ENV_ENDPOINT)
54+
55+
@pytest.fixture(scope="session")
56+
def text_analysis_key(environment_variables: EnvironmentVariableLoader) -> str:
57+
"""API key for Text Analysis tests."""
58+
return environment_variables.get(ENV_KEY)
59+
60+
# autouse=True will trigger this fixture on each pytest run
61+
# test_proxy auto-starts the test proxy
62+
# patch_sleep and patch_async_sleep remove wait times during polling
63+
@pytest.fixture(scope="session", autouse=True)
64+
def start_proxy(test_proxy, patch_sleep, patch_async_sleep):
65+
return
66+
```

0 commit comments

Comments
 (0)