Skip to content

Docs: Packages installed in the layer are different that the ones from aws_lambda_powertools[all] #1942

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
heitorlessa opened this issue Feb 20, 2023 Discussed in #1807 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@heitorlessa
Copy link
Contributor

Summary: Converting discussion into a doc issue so we can prioritize it in this iteration. We answered the discussion on why that is.

Discussed in #1807

Originally posted by ericbn January 4, 2023
Hi! 👋

Below is the list of installed packaged I get with a lambda using the arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV2:17 layer, obtained with this code:

import pkg_resources


def lambda_handler(event, context):
    print(*sorted(f"{i.key}=={i.version}" for i in pkg_resources.working_set), sep="\n")

Output:

aws-lambda-powertools==2.5.0
aws-xray-sdk==2.11.0
awslambdaric==2.0.4
boto3==1.20.32
botocore==1.23.32
fastjsonschema==2.16.2
jmespath==0.10.0
pip==22.0.4
pydantic==1.10.2
python-dateutil==2.8.2
s3transfer==0.5.2
setuptools==58.1.0
simplejson==3.17.2
six==1.16.0
typing-extensions==4.4.0
urllib3==1.26.9
wrapt==1.14.1

And these are the packages I get by installing aws_lambda_powertools[all,aws-sdk]==2.5.0:

❯ python3.9 -m venv venv
❯ . venv/bin/activate
❯ pip install 'aws_lambda_powertools[all,aws-sdk]==2.5.0'
❯ pip freeze --local
aws-lambda-powertools==2.5.0
aws-xray-sdk==2.11.0
boto3==1.26.42
botocore==1.29.42
fastjsonschema==2.16.2
jmespath==1.0.1
pydantic==1.10.4
python-dateutil==2.8.2
s3transfer==0.6.0
six==1.16.0
typing_extensions==4.4.0
urllib3==1.26.13
wrapt==1.14.1

Here's the difference (removed pip and setuptools from the left, which is the list from the layer):

SCR-20230104-fb5

Questions:

  1. Shouldn't the package versions all be the same between the layer and the aws_lambda_powertools extra(s)?
  2. Shouldn't awslambdaric and boto3 already be included in aws_lambda_powertools[all] (the "all" extra), or some other extra that is intended to match the packages in the layer?

I'm assuming it's a good practice to add aws_lambda_powertools[all]==2.5.0 to the dev dependencies and then deploy your lambdas only with extra dependencies beyond those already included as dev, because I was assuming those dev dependencies would be the exact same ones already provided in the arn:aws:lambda:us-east-1:017000801446:layer:AWSLambdaPowertoolsPythonV2:17 layer. In other words, I was expecting the diff above to perfectly match. I see it's not the case.

(Side question: Any plans on updating the boto3 version in next releases of the layer and the package?)

@heitorlessa heitorlessa added documentation Improvements or additions to documentation triage Pending triage from maintainers labels Feb 20, 2023
@heitorlessa heitorlessa self-assigned this Feb 20, 2023
@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 22, 2023
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Mar 6, 2023
@heitorlessa
Copy link
Contributor Author

Now merged. Attaching screenshots in case anyone else drops by before it's released.

image

image

image

@github-actions
Copy link
Contributor

This is now released under 2.10.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant