jsii-pacmak 1.101.0 → 1.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/builder.js CHANGED
@@ -49,6 +49,7 @@ class IndependentPackageBuilder {
49
49
  }
50
50
  catch (err) {
51
51
  logging.warn(`Failed building ${this.targetName}`);
52
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
52
53
  return await Promise.reject(err);
53
54
  }
54
55
  finally {
package/lib/index.js CHANGED
@@ -79,6 +79,7 @@ async function pacmak({ argv = {}, clean = true, codeOnly = false, fingerprint =
79
79
  }))
80
80
  .then(() => logging.info(`${targetSet.targetType} finished`), (err) => {
81
81
  logging.warn(`${targetSet.targetType} failed`);
82
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
82
83
  return Promise.reject(err);
83
84
  });
84
85
  }, { parallel }));
@@ -135,7 +136,9 @@ function mapParallelOrSerial(collection, mapper, { parallel }) {
135
136
  ? // Running parallel, or first element
136
137
  mapper(item)
137
138
  : // Wait for the previous promise, then make the next one
138
- result[result.length - 1].then(() => mapper(item), (error) => Promise.reject(error)));
139
+ result[result.length - 1].then(() => mapper(item),
140
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
141
+ (error) => Promise.reject(error)));
139
142
  }
140
143
  return result;
141
144
  }
@@ -994,6 +994,7 @@ async function tryDownloadResource(urlText, into) {
994
994
  fs.mkdirpSync(path.join(into, 'resources'));
995
995
  }
996
996
  catch (err) {
997
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
997
998
  return ko(err);
998
999
  }
999
1000
  try {
@@ -1018,6 +1019,7 @@ async function tryDownloadResource(urlText, into) {
1018
1019
  offset += fs.writeSync(fd, buff, offset);
1019
1020
  }
1020
1021
  catch (err) {
1022
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
1021
1023
  return ko(err);
1022
1024
  }
1023
1025
  }
@@ -1028,11 +1030,13 @@ async function tryDownloadResource(urlText, into) {
1028
1030
  ok(filePath);
1029
1031
  }
1030
1032
  catch (err) {
1033
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
1031
1034
  ko(err);
1032
1035
  }
1033
1036
  });
1034
1037
  }
1035
1038
  catch (err) {
1039
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
1036
1040
  return ko(err);
1037
1041
  }
1038
1042
  break;
package/lib/targets/go.js CHANGED
@@ -42,6 +42,7 @@ class Golang extends target_1.Target {
42
42
  }
43
43
  catch (e) {
44
44
  logging.info(`[${pkgDir}] Content of ${localGoMod.path} file:\n${localGoMod.content}`);
45
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
45
46
  return Promise.reject(e);
46
47
  }
47
48
  if (process.env.JSII_BUILD_GO) {
@@ -3,7 +3,7 @@
3
3
  # be installed in the virtual environment used for building the distribution
4
4
  # package (wheel, sdist), but not declared as build-system dependencies.
5
5
 
6
- setuptools~=67.3.2 # build-system
6
+ setuptools~=70.0.0 # build-system
7
7
  wheel~=0.42 # build-system
8
8
 
9
- twine~=5.0.0
9
+ twine~=5.1.1
@@ -305,8 +305,8 @@ function getPackageName(fqn, rootAssm) {
305
305
  const assemblyName = segments[0];
306
306
  const config = assemblyName === rootAssm.name
307
307
  ? rootAssm
308
- : rootAssm.dependencyClosure?.[assemblyName] ??
309
- (0, util_1.die)(`Unable to find configuration for assembly "${assemblyName}" in dependency closure`);
308
+ : (rootAssm.dependencyClosure?.[assemblyName] ??
309
+ (0, util_1.die)(`Unable to find configuration for assembly "${assemblyName}" in dependency closure`));
310
310
  const rootPkg = config.targets?.python?.module ??
311
311
  (0, util_1.die)(`No Python target was configured in assembly "${assemblyName}"`);
312
312
  const pkg = new Array();
@@ -634,7 +634,7 @@ class BaseProperty {
634
634
  // PyRight and MyPY both special-case @property, but not custom implementations such as our @classproperty...
635
635
  // MyPY reports on the re-declaration, but PyRight reports on the initial declaration (duh!)
636
636
  this.isStatic && !this.immutable
637
- ? 'pyright: ignore [reportGeneralTypeIssues]'
637
+ ? 'pyright: ignore [reportGeneralTypeIssues,reportRedeclaration]'
638
638
  : undefined);
639
639
  this.generator.emitDocString(code, this.apiLocation, this.docs, {
640
640
  documentableItem: `prop-${this.pythonName}`,
@@ -660,7 +660,10 @@ class BaseProperty {
660
660
  if ((this.shouldEmitBody || forceEmitBody) &&
661
661
  (!renderAbstract || !this.abstract)) {
662
662
  emitParameterTypeChecks(code, context, [`value: ${pythonType}`], `${this.pythonParent.fqn ?? this.pythonParent.pythonName}#${this.pythonName}`);
663
- code.line(`jsii.${this.jsiiSetMethod}(${this.implicitParameter}, "${this.jsName}", value)`);
663
+ // In case of a static setter, the 'cls' type is the class type but because we use a custom
664
+ // decorator to make the setter operate on classes instead of objects, pyright doesn't know about
665
+ // that and thinks the first argument is an instance instead of a class. Shut it up.
666
+ code.line(`jsii.${this.jsiiSetMethod}(${this.implicitParameter}, "${this.jsName}", value) # pyright: ignore[reportArgumentType]`);
664
667
  }
665
668
  else {
666
669
  code.line('...');
@@ -1188,7 +1191,28 @@ class PythonModule {
1188
1191
  code.line('import publication');
1189
1192
  code.line('import typing_extensions');
1190
1193
  code.line();
1191
- code.line('from typeguard import check_type');
1194
+ code.line('import typeguard');
1195
+ code.line('from importlib.metadata import version as _metadata_package_version');
1196
+ code.line("TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])");
1197
+ code.line();
1198
+ code.openBlock('def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any');
1199
+ code.openBlock('if TYPEGUARD_MAJOR_VERSION <= 2');
1200
+ code.line('return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore');
1201
+ code.closeBlock();
1202
+ code.openBlock('else');
1203
+ code.line('if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]');
1204
+ code.line(' pass');
1205
+ code.openBlock('else');
1206
+ code.openBlock('if TYPEGUARD_MAJOR_VERSION == 3');
1207
+ code.line('typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore');
1208
+ code.line('typeguard.check_type(value=value, expected_type=expected_type) # type:ignore');
1209
+ code.closeBlock();
1210
+ code.openBlock('else');
1211
+ code.line('typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore');
1212
+ code.closeBlock();
1213
+ code.closeBlock();
1214
+ code.closeBlock();
1215
+ code.closeBlock();
1192
1216
  // Determine if we need to write out the kernel load line.
1193
1217
  if (this.loadAssembly) {
1194
1218
  this.emitDependencyImports(code);
@@ -1471,7 +1495,7 @@ class Package {
1471
1495
  install_requires: [
1472
1496
  `jsii${(0, version_utils_1.toPythonVersionRange)(`^${version_1.VERSION}`)}`,
1473
1497
  'publication>=0.0.3',
1474
- 'typeguard~=2.13.3',
1498
+ 'typeguard>=2.13.3,<5.0.0',
1475
1499
  ]
1476
1500
  .concat(dependencies)
1477
1501
  .sort(),
package/lib/version.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The short version number for this jsii-pacmak release (e.g: `X.Y.Z`) */
2
2
  export declare const VERSION: string;
3
3
  /** The qualified version number for this jsii-pacmak release (e.g: `X.Y.Z (build #######)`) */
4
- export declare const VERSION_DESC = "1.101.0 (build b95fe5d)";
4
+ export declare const VERSION_DESC = "1.103.0 (build 3b9adc4)";
5
5
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
- // Generated at 2024-06-26T11:35:23Z by generate.sh
2
+ // Generated at 2024-08-27T18:25:01Z by generate.sh
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.VERSION_DESC = exports.VERSION = void 0;
5
5
  /** The short version number for this jsii-pacmak release (e.g: `X.Y.Z`) */
6
6
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
7
- exports.VERSION = '1.101.0';
7
+ exports.VERSION = '1.103.0';
8
8
  /** The qualified version number for this jsii-pacmak release (e.g: `X.Y.Z (build #######)`) */
9
- exports.VERSION_DESC = '1.101.0 (build b95fe5d)';
9
+ exports.VERSION_DESC = '1.103.0 (build 3b9adc4)';
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsii-pacmak",
3
- "version": "1.101.0",
3
+ "version": "1.103.0",
4
4
  "description": "A code generation framework for jsii backend languages",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,38 +37,38 @@
37
37
  "package": "package-js"
38
38
  },
39
39
  "dependencies": {
40
- "@jsii/check-node": "1.101.0",
41
- "@jsii/spec": "^1.101.0",
40
+ "@jsii/check-node": "1.103.0",
41
+ "@jsii/spec": "^1.103.0",
42
42
  "clone": "^2.1.2",
43
- "codemaker": "^1.101.0",
44
- "commonmark": "^0.31.0",
43
+ "codemaker": "^1.103.0",
44
+ "commonmark": "^0.31.1",
45
45
  "escape-string-regexp": "^4.0.0",
46
46
  "fs-extra": "^10.1.0",
47
- "jsii-reflect": "^1.101.0",
48
- "semver": "^7.6.0",
47
+ "jsii-reflect": "^1.103.0",
48
+ "semver": "^7.6.3",
49
49
  "spdx-license-list": "^6.9.0",
50
50
  "xmlbuilder": "^15.1.1",
51
51
  "yargs": "^16.2.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@jsii/dotnet-runtime": "^1.101.0",
55
- "@jsii/java-runtime": "^1.101.0",
56
- "@jsii/go-runtime": "^1.101.0",
57
- "@scope/jsii-calc-lib": "^1.101.0",
54
+ "@jsii/dotnet-runtime": "^1.103.0",
55
+ "@jsii/java-runtime": "^1.103.0",
56
+ "@jsii/go-runtime": "^1.103.0",
57
+ "@scope/jsii-calc-lib": "^1.103.0",
58
58
  "@types/clone": "^2.1.4",
59
- "@types/diff": "^5.2.0",
59
+ "@types/diff": "^5.2.1",
60
60
  "@types/commonmark": "^0.27.9",
61
61
  "@types/fs-extra": "^9.0.13",
62
62
  "@types/semver": "^7.5.8",
63
63
  "diff": "^5.2.0",
64
- "jsii": "^1.101.0",
65
- "jsii-build-tools": "^1.101.0",
64
+ "jsii": "^1.103.0",
65
+ "jsii-build-tools": "^1.103.0",
66
66
  "jsii-calc": "^3.20.120",
67
- "jsii-rosetta": "^1.101.0",
68
- "pyright": "^1.1.332"
67
+ "jsii-rosetta": "^1.103.0",
68
+ "pyright": "^1.1.377"
69
69
  },
70
70
  "peerDependencies": {
71
- "jsii-rosetta": "^1.101.0 || ~5.2.0 || ~5.3.0 || ~5.4.0"
71
+ "jsii-rosetta": "^1.103.0 || ~5.2.0 || ~5.3.0 || ~5.4.0 || ~5.5.0"
72
72
  },
73
73
  "keywords": [
74
74
  "jsii",