Skip to content

Commit

Permalink
Upgrade tcgc 0.43.1 (#2673)
Browse files Browse the repository at this point in the history
* upgrade tcgc

* changelog

* lint
  • Loading branch information
msyyc authored Jul 2, 2024
1 parent 1ab18bd commit ce1f514
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .chronus/changes/upgrade-tcgc-2024-6-2-11-32-39.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-python"
---

Upgrade TCGC 0.43.1
4 changes: 2 additions & 2 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@azure-tools/typespec-azure-core": ">=0.43.0 <1.0.0",
"@azure-tools/typespec-azure-resource-manager": ">=0.43.0 <1.0.0",
"@azure-tools/typespec-autorest": ">=0.43.0 <1.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.43.0 <1.0.0",
"@azure-tools/typespec-client-generator-core": ">=0.43.1 <1.0.0",
"@typespec/compiler": ">=0.57.0 <1.0.0",
"@typespec/http": ">=0.57.0 <1.0.0",
"@typespec/rest": ">=0.57.0 <1.0.0",
Expand Down Expand Up @@ -78,7 +78,7 @@
"rimraf": "~5.0.0",
"typescript": "~5.1.3",
"@azure-tools/typespec-azure-core": "~0.43.0",
"@azure-tools/typespec-client-generator-core": "~0.43.0",
"@azure-tools/typespec-client-generator-core": "~0.43.1",
"@typespec/compiler": "~0.57.0",
"@typespec/http": "~0.57.0",
"@typespec/rest": "~0.57.0",
Expand Down
5 changes: 1 addition & 4 deletions packages/typespec-python/src/code-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,7 @@ export function emitCodeModel<TServiceOperation extends SdkServiceOperation>(
getType(sdkContext, sdkEnum);
}
for (const client of sdkPackage.clients) {
if (client.initialization.access === "public") {
// right now to keep python changes minimal, we're just supporting top level clients
codeModel["clients"].push(emitClient(sdkContext, client));
}
codeModel["clients"].push(emitClient(sdkContext, client));
if (client.nameSpace === sdkPackage.rootNamespace) {
} else {
codeModel["subnamespaceToClients"][client.nameSpace] = emitClient(sdkContext, client);
Expand Down
6 changes: 3 additions & 3 deletions packages/typespec-python/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SdkArrayType,
SdkDictionaryType,
SdkConstantType,
SdkDatetimeType,
SdkDateTimeType,
SdkDurationType,
SdkCredentialType,
SdkServiceOperation,
Expand Down Expand Up @@ -312,7 +312,7 @@ function emitEnumMember(type: SdkEnumValueType, enumType: Record<string, any>):
};
}

function emitDurationOrDateType(type: SdkDurationType | SdkDatetimeType): Record<string, any> {
function emitDurationOrDateType(type: SdkDurationType | SdkDateTimeType): Record<string, any> {
return getSimpleTypeResult({
...emitBuiltInType(type),
wireType: emitBuiltInType(type.wireType),
Expand Down Expand Up @@ -367,7 +367,7 @@ const sdkScalarKindToPythonKind: Record<string, string> = {
azureLocation: "string",
};

function emitBuiltInType(type: SdkBuiltInType | SdkDurationType | SdkDatetimeType): Record<string, any> {
function emitBuiltInType(type: SdkBuiltInType | SdkDurationType | SdkDateTimeType): Record<string, any> {
if (type.kind === "duration" && type.encode === "seconds") {
return getSimpleTypeResult({
type: sdkScalarKindToPythonKind[type.wireType.kind],
Expand Down
33 changes: 22 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ce1f514

Please sign in to comment.