Skip to content

feat: Only install typing-extensions dependency when necessary missing in some files #3091

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

Closed
1 of 2 tasks
HarbingersRequiem opened this issue Sep 14, 2023 · 9 comments · Fixed by #3092
Closed
1 of 2 tasks
Assignees
Labels
typing Static typing definition related issues (mypy, pyright, etc.)

Comments

@HarbingersRequiem
Copy link

HarbingersRequiem commented Sep 14, 2023

Use case

This is the same issue as noted in #280. Looks like the following files are missing the conditionals put in which is causing issues, for me at least, with some Lambda scripts:

  • aws_lambda_powertools/event_handler/middlewares/base.py
  • aws_lambda_powertools/metrics/provider/cloudwatch_emf/types.py
  • aws_lambda_powertools/metrics/types.py
  • aws_lambda_powertools/utilities/batch/types.py
  • aws_lambda_powertools/utilities/parameters/ssm.py
  • aws_lambda_powertools/utilities/parameters/types.py
  • aws_lambda_powertools/utilities/streaming/s3_object.py

Solution/User Experience

Same as previous feat. Add the conditionals around the import for typing_extensions

Alternative solutions

No response

Acknowledgment

@HarbingersRequiem HarbingersRequiem added feature-request feature request triage Pending triage from maintainers labels Sep 14, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 14, 2023

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@heitorlessa
Copy link
Contributor

hey @HarbingersRequiem, thank you for reporting it -- did it cause you a runtime error in Lambda? if so, we'll switch it to bug and get on it now.

Apologies for letting this slip during PRs, we'll think of a linter or a shared types to make this sustainable.

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Sep 14, 2023
@heitorlessa heitorlessa moved this from Triage to Pending customer in Powertools for AWS Lambda (Python) Sep 14, 2023
@HarbingersRequiem
Copy link
Author

Hey @heitorlessa, it did, yeah. Got this out of it "[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'typing_extensions' Traceback (most recent call last):"

Thanks for the quick response on it!

@heitorlessa
Copy link
Contributor

okay, working on that now. Switching to bug.

@heitorlessa heitorlessa added bug Something isn't working and removed feature-request feature request labels Sep 14, 2023
@heitorlessa heitorlessa self-assigned this Sep 14, 2023
@heitorlessa heitorlessa moved this from Pending customer to Working on it in Powertools for AWS Lambda (Python) Sep 14, 2023
@heitorlessa
Copy link
Contributor

One quick note only... typing_extensions is a required dependency in Powertools. Back then we made it optional for 3.7 only.

typing-extensions = "^4.6.2"

That shouldn't cause the No module named 'typing_extensions'.

@heitorlessa heitorlessa added typing Static typing definition related issues (mypy, pyright, etc.) and removed bug Something isn't working labels Sep 14, 2023
@heitorlessa
Copy link
Contributor

PR in, classified as typing instead of bug as couldn't reproduce at runtime using the latest version given it's a runtime dependency.

@leandrodamascena leandrodamascena linked a pull request Sep 14, 2023 that will close this issue
16 tasks
@heitorlessa
Copy link
Contributor

All good and tested. Because we can't reproduce at runtime when installing the latest powertools for AWS version, we'll make a release tomorrow instead of now.

Still, we care about it :)

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Sep 14, 2023
@github-actions
Copy link
Contributor

This is now released under 2.25.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Sep 15, 2023
@heitorlessa heitorlessa moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing Static typing definition related issues (mypy, pyright, etc.)
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

2 participants