Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade python runtime version of typeguard to >=3.0.2 #4470

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@jsii/python-runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"cattrs>=1.8,<23.3",
"importlib_resources>=5.2.0",
"publication>=0.0.3", # This is used by all generated code.
"typeguard~=2.13.3", # This is used by all generated code.
"typeguard>=3.0.2", # This is used by all generated code.
"python-dateutil",
"typing_extensions>=3.8,<5.0",
],
Expand Down
7 changes: 3 additions & 4 deletions packages/jsii-pacmak/lib/targets/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ abstract class BaseProperty implements PythonBase {
class Interface extends BasePythonClassType {
public emit(code: CodeMaker, context: EmitContext) {
context = nestedContext(context, this.fqn);
code.line('@typing.runtime_checkable');
emitList(code, '@jsii.interface(', [`jsii_type="${this.fqn}"`], ')');

// First we do our normal class logic for emitting our members.
Expand Down Expand Up @@ -2125,7 +2126,7 @@ class Package {
install_requires: [
`jsii${toPythonVersionRange(`^${VERSION}`)}`,
'publication>=0.0.3',
'typeguard~=2.13.3',
'typeguard>=3.0.2',
]
.concat(dependencies)
.sort(),
Expand Down Expand Up @@ -3202,9 +3203,7 @@ function emitParameterTypeChecks(
comment = ' # pyright: ignore [reportGeneralTypeIssues]';
}
code.line(
`check_type(argname=${JSON.stringify(
`argument ${name}`,
)}, value=${name}, expected_type=${expectedType})${comment}`,
`check_type(value=${name}, expected_type=${expectedType})${comment}`,
);
}
if (openedBlock) {
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.

Loading
Loading