[Python] Return package source root in generateOutput.json path
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
## Problem
The Python SDK generation output currently sets a package's `path` to the service folder instead of the package source-code root.
For `azure-mgmt-devtestlabs`, the current output is:
```json
{
"path": ["sdk/devtestlabs"]
}
```
It should be:
```json
{
"path": ["sdk/devtestlabs/azure-mgmt-devtestlabs"]
}
```
The path must be relative to the root of the `azure-sdk-for-python` repository and must point to the root folder of the generated package source code.
`spec-gen-sdk` uses the first applicable entry in `generateOutput.json` as `PackageData.relativeFolderPath`. That value is subsequently returned as `PackageReport.packageRootPath` in the execution report. Returning the service directory therefore produces an incorrect package root path for Python.
## Pipeline evidence
[Pipelines - Run 20260904.57 logs](https://dev.azure.com/azure-sdk/public/_build/results?buildId=6791964&view=logs&j=83516c17-6666-5250-abde-63983ce72a49&t=00be4b52-4a63-5865-8e02-c61723ad0692)
## Expected behavior
Each Python package in `generateOutput.json` should report the package source-code root relative to the `azure-sdk-for-python` repository root, rather than the containing service directory.
## Acceptance criteria
- `azure-mgmt-devtestlabs` reports `sdk/devtestlabs/azure-mgmt-devtestlabs`.
- Other Python packages report their package source-code roots, including services containing multiple packages.
- Tests cover the Python package-path output.
Contributor guide
Assessment
This issue has not been assessed yet.