Skip to content

[Python] generate metadata files #7359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

[Python] generate metadata files #7359

wants to merge 7 commits into from

Conversation

msyyc
Copy link
Contributor

@msyyc msyyc commented May 15, 2025

fix #7057

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label May 15, 2025
Copy link
Contributor

github-actions bot commented May 15, 2025

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - feature ✏️

store apiVersion info in _metadata.json

@azure-sdk
Copy link
Collaborator

azure-sdk commented May 15, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@msyyc msyyc marked this pull request as ready for review May 16, 2025 02:56
@msyyc msyyc changed the title [WIP][Python] generate metadata files [Python] generate metadata files May 16, 2025
@@ -323,5 +323,8 @@ export function emitCodeModel(sdkContext: PythonSdkContext) {
...simpleTypesMap.values(),
];
codeModel["crossLanguagePackageId"] = ignoreDiagnostics(getCrossLanguagePackageId(sdkContext));
if ((sdkContext.emitContext.options as any).flavor === "azure") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any test cases that we could verify this change?

Copy link
Contributor Author

@msyyc msyyc May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_metadata.json is not part of package so we can't test it by import then check like other cases. You can see the generated file in PR https://github.com/Azure/autorest.python/pull/3089/files#diff-3cd63a63f5c9e91001bdea81bb22b04fb20951ffae50393999131961cd61af6b

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see. So for python, we only include the value of api-version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[python] Generate a metadata file while emitting
4 participants