-
Notifications
You must be signed in to change notification settings - Fork 246
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
Upgrade version of typeguard in python runtime #4469
Comments
Just tested a monkey patch and removing the import typeguard
old_check_type = typeguard.check_type
def new_check_type(*args: Any, **kwargs: Any) -> Any:
if "argname" in kwargs:
del kwargs["argname"]
return old_check_type(*args, **kwargs)
typeguard.check_type = new_check_type But I do get a bunch of warnings: /./packyak.config.py:11: UserWarning: Typeguard cannot check the IReusableStackSynthesizer protocol because it is a non-runtime protocol. If you would like to type check this protocol, please use @typing.runtime_checkable
return old_check_type(*args, **kwargs)
/./packyak.config.py:11: UserWarning: Typeguard cannot check the IStackSynthesizer protocol because it is a non-runtime protocol. If you would like to type check this protocol, please use @typing.runtime_checkable
return old_check_type(*args, **kwargs) |
This issue is now closed. Comments on closed issues are hard for our team to see. |
1 similar comment
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature
The python runtime for the CDK has an old and inflexible dependency on
typeguard~=2.13.3
https://github.com/aws/jsii/blob/main/packages/%40jsii/python-runtime/setup.py#L37C10-L37C27
Use Case
I would like to have a CDK application include the latest pandera libraries but this fixed dependency is a blocker.
Proposed Solution
Increase the range and add version-aware adaptation code if required to handle the different versions.
Later versions of
typeguard
no longer accept theargname
parameter. We'd have to change this line of code:jsii/packages/jsii-pacmak/lib/targets/python.ts
Lines 3205 to 3207 in 576fd20
Other Information
No response
Acknowledgements
CDK version used
2.134.0
Environment details (OS name and version, etc.)
Mac OS
The text was updated successfully, but these errors were encountered: