diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index d735772c62..b22dbea4b5 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -34,7 +34,8 @@ "cattrs>=1.8,<24.2", "importlib_resources>=5.2.0", "publication>=0.0.3", # This is used by all generated code. - "typeguard>=2.13.3,<5.0.0", # This is used by all generated code. + # 4.3.0 is incompatible with generated bindings, see https://github.com/aws/jsii/issues/4658 + "typeguard>=2.13.3,<4.3.0", # This is used by all generated code. "python-dateutil", "typing_extensions>=3.8,<5.0", ], diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 938f0aea2b..75226ca26c 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1730,7 +1730,9 @@ class PythonModule implements PythonType { code.line(); code.line('import typeguard'); - code.line('from importlib.metadata import version as _metadata_package_version'); + code.line( + 'from importlib.metadata import version as _metadata_package_version', + ); code.line( "TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])", ); @@ -2166,7 +2168,8 @@ class Package { install_requires: [ `jsii${toPythonVersionRange(`^${VERSION}`)}`, 'publication>=0.0.3', - 'typeguard>=2.13.3,<5.0.0', + // 4.3.0 is incompatible with generated bindings, see https://github.com/aws/jsii/issues/4658 + 'typeguard>=2.13.3,<4.3.0', ] .concat(dependencies) .sort(), diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap index e336eb85d5..3e81e47dd8 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap @@ -1270,7 +1270,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -2727,7 +2727,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap index 28b1cecf14..82ade498b9 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap @@ -459,7 +459,7 @@ kwargs = json.loads( "bar>=2.0.0.rc42, <3.0.0", "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -991,7 +991,7 @@ kwargs = json.loads( "bar>=4.5.6.dev1337, <5.0.0", "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1502,7 +1502,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -2011,7 +2011,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap index f678c870ee..e67b662154 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap @@ -294,7 +294,7 @@ kwargs = json.loads( "jsii<0.0.1", "publication>=0.0.3", "scope.jsii-calc-base-of-base>=2.1.1, <3.0.0", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -883,7 +883,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1450,7 +1450,7 @@ kwargs = json.loads( "publication>=0.0.3", "scope.jsii-calc-base-of-base>=2.1.1, <3.0.0", "scope.jsii-calc-base<0.0.1", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -3219,7 +3219,7 @@ kwargs = json.loads( "publication>=0.0.3", "scope.jsii-calc-base<0.0.1", "scope.jsii-calc-lib<0.0.1", - "typeguard>=2.13.3,<5.0.0" + "typeguard>=2.13.3,<4.3.0" ], "classifiers": [ "Intended Audience :: Developers",