Skip to content

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

Closed

Description

@HarbingersRequiem

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

Activity

  1. added
    feature-request
    triage
    on Sep 14, 2023
  2. boring-cyborg commented on Sep 14, 2023

    @boring-cyborg

    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

  3. heitorlessa commented on Sep 14, 2023

    @heitorlessa
    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.

  4. removed
    triage
    on Sep 14, 2023
  5. moved this from Triage to Pending customer in Powertools for AWS Lambda (Python)on Sep 14, 2023
  6. HarbingersRequiem commented on Sep 14, 2023

    @HarbingersRequiem
    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!

  7. heitorlessa commented on Sep 14, 2023

    @heitorlessa
    Contributor

    okay, working on that now. Switching to bug.

  8. added
    bug
    and removed
    feature-request
    on Sep 14, 2023
  9. self-assigned this
    on Sep 14, 2023
  10. moved this from Pending customer to Working on it in Powertools for AWS Lambda (Python)on Sep 14, 2023
  11. heitorlessa commented on Sep 14, 2023

    @heitorlessa
    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'.

  12. added
    typing
    and removed
    bug
    on Sep 14, 2023
  13. heitorlessa commented on Sep 14, 2023

    @heitorlessa
    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.

  14. heitorlessa commented on Sep 14, 2023

    @heitorlessa
    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 :)

  15. github-actions commented on Sep 14, 2023

    @github-actions
    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.

  16. added
    pending-release
    on Sep 14, 2023
  17. github-actions commented on Sep 15, 2023

    @github-actions
    Contributor

    This is now released under 2.25.0 version!

  18. removed
    pending-release
    on Sep 15, 2023
  19. moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python)on Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

typing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions