Skip to content

Commit

Permalink
chore(release): v1.65.1 (#3729)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller authored Aug 29, 2022
2 parents 7a02b7f + 03e190f commit b0947e4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.65.1](https://github.com/aws/jsii/compare/v1.65.0...v1.65.1) (2022-08-29)


### Bug Fixes

* **python:** reference to type does not use alias ([#3728](https://github.com/aws/jsii/pull/3728))


## [1.65.0](https://github.com/aws/jsii/compare/v1.64.0...v1.65.0) (2022-08-18)


Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"rejectCycles": true
}
},
"version": "1.65.0"
"version": "1.65.1"
}
9 changes: 5 additions & 4 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ abstract class BaseMethod implements PythonBase {
const paramType = toTypeName(prop.prop).pythonType({
...context,
parameterType: true,
typeAnnotation: true,
});
const paramDefault = prop.prop.optional ? ' = None' : '';

Expand Down Expand Up @@ -1133,10 +1134,10 @@ class Struct extends BasePythonClassType {
// Re-type struct arguments that were passed as "dict". Do this before validating argument types...
for (const member of members.filter((m) => m.isStruct(this.generator))) {
// Note that "None" is NOT an instance of dict (that's convenient!)
const typeName = toPythonFullName(
(member.type.type as spec.NamedTypeReference).fqn,
context.assembly,
);
const typeName = toTypeName(member.type.type).pythonType({
...context,
typeAnnotation: false,
});
code.openBlock(`if isinstance(${member.pythonName}, dict)`);
code.line(`${member.pythonName} = ${typeName}(**${member.pythonName})`);
code.closeBlock();
Expand Down
6 changes: 3 additions & 3 deletions packages/jsii-pacmak/lib/targets/python/type-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class UserType implements TypeName {
// Identify declarations that are not yet initialized and hence cannot be
// used as part of a type qualification. Since this is not a forward
// reference, the type was already emitted and its un-qualified name must
// be used instead of it's locally qualified name.
// be used instead of its locally qualified name.
const nestingParent = surroundingTypeFqns
?.map((fqn) => toPythonFqn(fqn, assembly).pythonFqn)
?.reverse()
Expand All @@ -357,7 +357,7 @@ class UserType implements TypeName {
// This is not for a type annotation, so we should be at a point in time
// where the surrounding symbol has been defined entirely, so we can
// refer to it "normally" now.
return { pythonType: pythonFqn.substring(nestingParent.length + 1) };
return { pythonType: pythonFqn.slice(packageName.length + 1) };
}

// We'll just make a module-qualified reference at this point.
Expand All @@ -380,7 +380,7 @@ class UserType implements TypeName {
const alias = `_${toImport}_${aliasSuffix}`;

return {
pythonType: [alias, ...nested].join('.'),
pythonType: wrapType([alias, ...nested].join('.')),
requiredImport: {
sourcePackage: relativeImportPath(
submodulePythonName,
Expand Down

0 comments on commit b0947e4

Please sign in to comment.