Skip to content

Commit

Permalink
fix: Python constructs do not implement a compatible interface (#4659)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrgrain authored Oct 11, 2024
1 parent 091ad3e commit 2749695
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/@jsii/python-runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down
7 changes: 5 additions & 2 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])",
);
Expand Down Expand Up @@ -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(),
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.

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

0 comments on commit 2749695

Please sign in to comment.