Skip to content

Commit 2749695

Browse files
authored
fix: Python constructs do not implement a compatible interface (#4659)
Narrows the typeguard dependency constraint down to actually supported versions. [email protected] is incompatible with the currently generated bindings, see #4658 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent 091ad3e commit 2749695

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

packages/@jsii/python-runtime/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"cattrs>=1.8,<24.2",
3535
"importlib_resources>=5.2.0",
3636
"publication>=0.0.3", # This is used by all generated code.
37-
"typeguard>=2.13.3,<5.0.0", # This is used by all generated code.
37+
# 4.3.0 is incompatible with generated bindings, see https://github.com/aws/jsii/issues/4658
38+
"typeguard>=2.13.3,<4.3.0", # This is used by all generated code.
3839
"python-dateutil",
3940
"typing_extensions>=3.8,<5.0",
4041
],

packages/jsii-pacmak/lib/targets/python.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,9 @@ class PythonModule implements PythonType {
17301730
code.line();
17311731

17321732
code.line('import typeguard');
1733-
code.line('from importlib.metadata import version as _metadata_package_version');
1733+
code.line(
1734+
'from importlib.metadata import version as _metadata_package_version',
1735+
);
17341736
code.line(
17351737
"TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])",
17361738
);
@@ -2166,7 +2168,8 @@ class Package {
21662168
install_requires: [
21672169
`jsii${toPythonVersionRange(`^${VERSION}`)}`,
21682170
'publication>=0.0.3',
2169-
'typeguard>=2.13.3,<5.0.0',
2171+
// 4.3.0 is incompatible with generated bindings, see https://github.com/aws/jsii/issues/4658
2172+
'typeguard>=2.13.3,<4.3.0',
21702173
]
21712174
.concat(dependencies)
21722175
.sort(),

packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)