Skip to content

Commit

Permalink
chore(release): 1.63.2 (#3689)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainMuller authored Jul 29, 2022
2 parents 185bb34 + b680fd8 commit a8a8833
Show file tree
Hide file tree
Showing 14 changed files with 1,082 additions and 965 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.63.2](https://github.com/aws/jsii/compare/v1.63.1...v1.63.2) (2022-07-29)


### Bug Fixes

* **pyhon:** under-qualified types used by dynamic type checking ([#3688](https://github.com/aws/jsii/issues/3688)) ([833a717](https://github.com/aws/jsii/commit/833a71781c9e4fee1522d75e53d3de76b93439f5))

## [1.63.1](https://github.com/aws/jsii/compare/v1.63.0...v1.63.1) (2022-07-26)


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.63.1"
"version": "1.63.2"
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@jest/types": "^28.1.3",
"@types/jest": "^28.1.6",
"@types/node": "^14.18.22",
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"all-contributors-cli": "^6.20.0",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -31,7 +31,7 @@
"jest-circus": "^28.1.3",
"jest-config": "^28.1.3",
"jest-expect-message": "^1.0.2",
"lerna": "^5.1.8",
"lerna": "^5.3.0",
"prettier": "^2.7.1",
"standard-version": "^9.5.0",
"ts-node": "^10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"fs-extra": "^10.1.0",
"jsii": "^0.0.0",
"npm": "^8.14.0",
"npm": "^8.15.0",
"tar": "^6.1.11",
"typescript": "~3.9.10",
"yargs": "^16.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import re

from scope.jsii_calc_lib.custom_submodule_name import NestingClass
import jsii_calc


Expand Down Expand Up @@ -114,3 +115,7 @@ def test_setter_to_union(self):
),
):
subject.union_property = jsii_calc.StringEnum.B # type:ignore

def test_nested_struct(self):
# None of these should throw...
NestingClass.NestedStruct(name="Queen B")
2 changes: 1 addition & 1 deletion packages/@jsii/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"jsii-build-tools": "^0.0.0",
"jsii-calc": "^3.20.120",
"source-map-loader": "^4.0.0",
"webpack": "^5.73.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
}
2 changes: 1 addition & 1 deletion packages/jsii-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@jsii/spec": "^0.0.0",
"fs-extra": "^10.1.0",
"jsii-reflect": "^0.0.0",
"log4js": "^6.6.0",
"log4js": "^6.6.1",
"yargs": "^16.2.0"
},
"devDependencies": {
Expand Down
28 changes: 13 additions & 15 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
PythonImports,
mergePythonImports,
toPackageName,
toPythonFullName,
} from './python/type-name';
import { die, toPythonIdentifier } from './python/util';
import { toPythonVersionRange, toReleaseVersion } from './version-utils';
Expand Down Expand Up @@ -466,7 +467,6 @@ abstract class BaseMethod implements PythonBase {
private readonly returns: spec.OptionalValue | undefined,
public readonly docs: spec.Docs | undefined,
public readonly isStatic: boolean,
private readonly pythonParent: PythonType,
opts: BaseMethodOpts,
) {
this.abstract = !!opts.abstract;
Expand Down Expand Up @@ -674,7 +674,9 @@ abstract class BaseMethod implements PythonBase {
emitParameterTypeChecks(
code,
pythonParams.slice(1),
`${this.pythonParent.pythonName}.${this.pythonName}`,
`${toPythonFullName(this.parent.fqn, context.assembly)}.${
this.pythonName
}`,
);
}
this.emitBody(
Expand Down Expand Up @@ -867,7 +869,6 @@ abstract class BaseProperty implements PythonBase {
private readonly jsName: string,
private readonly type: spec.OptionalValue,
public readonly docs: spec.Docs | undefined,
private readonly pythonParent: PythonType,
opts: BasePropertyOpts,
) {
const { abstract = false, immutable = false, isStatic = false } = opts;
Expand Down Expand Up @@ -952,9 +953,10 @@ abstract class BaseProperty implements PythonBase {
// In order to get a property accessor, we must resort to getting the
// attribute on the type, instead of the value (where the getter would
// be implicitly invoked for us...)
`getattr(${this.pythonParent.pythonName}, ${JSON.stringify(
this.pythonName,
)}).fset`,
`getattr(${toPythonFullName(
this.parent.fqn,
context.assembly,
)}, ${JSON.stringify(this.pythonName)}).fset`,
);
code.line(
`jsii.${this.jsiiSetMethod}(${this.implicitParameter}, "${this.jsName}", value)`,
Expand Down Expand Up @@ -1141,7 +1143,11 @@ class Struct extends BasePythonClassType {
code.line(`${member.pythonName} = ${typeName}(**${member.pythonName})`);
code.closeBlock();
}
emitParameterTypeChecks(code, kwargs, `${this.pythonName}.__init__`);
emitParameterTypeChecks(
code,
kwargs,
`${toPythonFullName(this.spec.fqn, context.assembly)}.__init__`,
);

// Required properties, those will always be put into the dict
assignDictionary(
Expand Down Expand Up @@ -2605,7 +2611,6 @@ class PythonGenerator extends Generator {
undefined,
cls.initializer.docs,
false, // Never static
klass,
{ liftedProp: this.getliftedProp(cls.initializer), parent: cls },
),
);
Expand All @@ -2628,7 +2633,6 @@ class PythonGenerator extends Generator {
method.returns,
method.docs,
true, // Always static
klass,
{
abstract: method.abstract,
liftedProp: this.getliftedProp(method),
Expand All @@ -2647,7 +2651,6 @@ class PythonGenerator extends Generator {
prop.name,
prop,
prop.docs,
klass,
{
abstract: prop.abstract,
immutable: prop.immutable,
Expand All @@ -2673,7 +2676,6 @@ class PythonGenerator extends Generator {
method.returns,
method.docs,
!!method.static,
klass,
{
abstract: method.abstract,
liftedProp: this.getliftedProp(method),
Expand All @@ -2691,7 +2693,6 @@ class PythonGenerator extends Generator {
method.returns,
method.docs,
!!method.static,
klass,
{
abstract: method.abstract,
liftedProp: this.getliftedProp(method),
Expand All @@ -2711,7 +2712,6 @@ class PythonGenerator extends Generator {
prop.name,
prop,
prop.docs,
klass,
{
abstract: prop.abstract,
immutable: prop.immutable,
Expand Down Expand Up @@ -2773,7 +2773,6 @@ class PythonGenerator extends Generator {
method.returns,
method.docs,
!!method.static,
klass,
{ liftedProp: this.getliftedProp(method), parent: ifc },
),
);
Expand All @@ -2793,7 +2792,6 @@ class PythonGenerator extends Generator {
prop.name,
prop,
prop.docs,
klass,
{ immutable: prop.immutable, isStatic: prop.static, parent: ifc },
);
}
Expand Down
14 changes: 14 additions & 0 deletions packages/jsii-pacmak/lib/targets/python/type-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,20 @@ export function toPythonFqn(fqn: string, rootAssm: Assembly) {
return { assemblyName, packageName, pythonFqn: fqnParts.join('.') };
}

/**
* Computes the nesting-qualified name of a type.
*
* @param fqn the fully qualified jsii name of the type.
* @param rootAssm the root assembly for the project.
*
* @returns the nesting-qualified python type name (the name of the class,
* qualified with all nesting parent classes).
*/
export function toPythonFullName(fqn: string, rootAssm: Assembly): string {
const { packageName, pythonFqn } = toPythonFqn(fqn, rootAssm);
return pythonFqn.slice(packageName.length + 1);
}

/**
* Computes the python relative import path from `fromModule` to `toModule`.
*
Expand Down

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

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

3 changes: 2 additions & 1 deletion packages/jsii-rosetta/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createRequire } from 'node:module';
import { overriddenConfig } from '../../jest.config.mjs';
import { default as defaultConfig, overriddenConfig } from '../../jest.config.mjs';

export default overriddenConfig({
setupFiles: [createRequire(import.meta.url).resolve('./jestsetup.js')],
testTimeout: process.env.CI === 'true' ? 30_000 : defaultConfig.testTimeout,
});
2 changes: 1 addition & 1 deletion packages/jsii/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"chalk": "^4",
"fast-deep-equal": "^3.1.3",
"fs-extra": "^10.1.0",
"log4js": "^6.6.0",
"log4js": "^6.6.1",
"semver": "^7.3.7",
"semver-intersect": "^1.4.0",
"sort-json": "^2.0.1",
Expand Down
Loading

0 comments on commit a8a8833

Please sign in to comment.