Skip to content

Conversation

heitorlessa
Copy link
Contributor

Issue number: #1321

Summary

Changes

Please provide a summary of what's being changed

Ensures mypy typing dependencies are set as dev dependencies to not impact customers final package size.

  • Removed mypy types as prod deps: poetry remove mypy-boto3-cloudwatch mypy-boto3-lambda mypy-boto3-xray
  • Added mypy types as dev deps: poetry add mypy-boto3-cloudwatch mypy-boto3-lambda mypy-boto3-xray --dev

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@boring-cyborg boring-cyborg bot added the dependencies Pull requests that update a dependency file label Jul 20, 2022
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 20, 2022
@github-actions github-actions bot added the bug Something isn't working label Jul 20, 2022
@heitorlessa
Copy link
Contributor Author

grep output to ensure these imports are not in the prod package

08:50:10 ➜ aws-lambda-powertools-python git:(fix/mypy-type-dev-dep$?) grep "mypy_boto3_cloudwatch" -R .        
./tests/e2e/utils/helpers.py:from mypy_boto3_cloudwatch import type_defs
./tests/e2e/utils/helpers.py:from mypy_boto3_cloudwatch.client import CloudWatchClient
./poetry.lock:    {file = "mypy_boto3_cloudwatch-1.24.0-py3-none-any.whl", hash = "sha256:82dac27b1dd0ad8969fedf874ea4713b36d37fe04229f7fdaaecf4addb59d4bd"},

08:50:41 ➜ aws-lambda-powertools-python git:(fix/mypy-type-dev-dep$?) grep "mypy_boto3_lambda" -R .                     
./tests/e2e/utils/helpers.py:from mypy_boto3_lambda.client import LambdaClient
./poetry.lock:    {file = "mypy_boto3_lambda-1.24.0-py3-none-any.whl", hash = "sha256:a286a464513adf50847bda8573f2dc7adc348234827d1ac0200e610ee9a09b80"},

08:50:53 ➜ aws-lambda-powertools-python git:(fix/mypy-type-dev-dep$?) grep "mypy_boto3_xray" -R .                 
./tests/e2e/utils/helpers.py:from mypy_boto3_xray.client import XRayClient
./poetry.lock:    {file = "mypy_boto3_xray-1.24.0-py3-none-any.whl", hash = "sha256:6b9bc96e7924215fe833fe0d732d5e3ce98f7739b373432b9735a9905f867171"},

@codecov-commenter
Copy link

Codecov Report

Merging #1322 (26f9493) into develop (5d964a0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #1322   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files          119      119           
  Lines         5427     5427           
  Branches       619      619           
========================================
  Hits          5421     5421           
  Misses           2        2           
  Partials         4        4           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6ed979...26f9493. Read the comment docs.

@heitorlessa
Copy link
Contributor Author

Given the need for an emergency release, I'll merge without a second approval (not yet in working hours for them).

Installed the new package locally for extra due diligence:

New with mypy types as dev dependencies

ll /tmp/pt-new-prod
total 96
-rw-r--r--   1 lessa  1896053708    10K 20 Jul 08:56 THIRD-PARTY-LICENSES
drwxr-xr-x   3 lessa  1896053708    96B 20 Jul 08:56 __pycache__
drwxr-xr-x  14 lessa  1896053708   448B 20 Jul 08:56 aws_lambda_powertools
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 aws_lambda_powertools-1.26.4.dist-info
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:56 aws_xray_sdk
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 aws_xray_sdk-2.10.0.dist-info
drwxr-xr-x   4 lessa  1896053708   128B 20 Jul 08:56 bin
drwxr-xr-x  15 lessa  1896053708   480B 20 Jul 08:56 boto3
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 boto3-1.24.33.dist-info
drwxr-xr-x  45 lessa  1896053708   1.4K 20 Jul 08:56 botocore
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 botocore-1.27.33.dist-info
drwxr-xr-x  14 lessa  1896053708   448B 20 Jul 08:56 dateutil
drwxr-xr-x  13 lessa  1896053708   416B 20 Jul 08:56 fastjsonschema
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 fastjsonschema-2.16.1.dist-info
drwxr-xr-x  11 lessa  1896053708   352B 20 Jul 08:56 jmespath
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:56 jmespath-1.0.1.dist-info
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 python_dateutil-2.8.2.dist-info
drwxr-xr-x  19 lessa  1896053708   608B 20 Jul 08:56 s3transfer
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 s3transfer-0.6.0.dist-info
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:56 six-1.16.0.dist-info
-rw-r--r--   1 lessa  1896053708    34K 20 Jul 08:56 six.py
drwxr-xr-x  17 lessa  1896053708   544B 20 Jul 08:56 urllib3
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:56 urllib3-1.26.10.dist-info
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:56 wrapt
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:56 wrapt-1.14.1.dist-info

Current release with mypy dependencies

ll /tmp/pt-mypy
total 248
-rw-r--r--   1 lessa  1896053708    10K 20 Jul 08:53 THIRD-PARTY-LICENSES
drwxr-xr-x   4 lessa  1896053708   128B 20 Jul 08:53 __pycache__
drwxr-xr-x  14 lessa  1896053708   448B 20 Jul 08:53 aws_lambda_powertools
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 aws_lambda_powertools-1.26.4.dist-info
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 aws_xray_sdk
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 aws_xray_sdk-2.10.0.dist-info
drwxr-xr-x   4 lessa  1896053708   128B 20 Jul 08:53 bin
drwxr-xr-x  15 lessa  1896053708   480B 20 Jul 08:53 boto3
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 boto3-1.24.33.dist-info
drwxr-xr-x  45 lessa  1896053708   1.4K 20 Jul 08:53 botocore
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 botocore-1.27.33.dist-info
drwxr-xr-x  14 lessa  1896053708   448B 20 Jul 08:53 dateutil
drwxr-xr-x  13 lessa  1896053708   416B 20 Jul 08:53 fastjsonschema
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 fastjsonschema-2.16.1.dist-info
drwxr-xr-x  11 lessa  1896053708   352B 20 Jul 08:53 jmespath
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 jmespath-1.0.1.dist-info
drwxr-xr-x  20 lessa  1896053708   640B 20 Jul 08:53 mypy_boto3_cloudwatch
drwxr-xr-x   7 lessa  1896053708   224B 20 Jul 08:53 mypy_boto3_cloudwatch-1.24.0.dist-info
drwxr-xr-x  18 lessa  1896053708   576B 20 Jul 08:53 mypy_boto3_lambda
drwxr-xr-x   7 lessa  1896053708   224B 20 Jul 08:53 mypy_boto3_lambda-1.24.0.dist-info
drwxr-xr-x  16 lessa  1896053708   512B 20 Jul 08:53 mypy_boto3_xray
drwxr-xr-x   7 lessa  1896053708   224B 20 Jul 08:53 mypy_boto3_xray-1.24.0.dist-info
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 python_dateutil-2.8.2.dist-info
drwxr-xr-x  19 lessa  1896053708   608B 20 Jul 08:53 s3transfer
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 s3transfer-0.6.0.dist-info
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 six-1.16.0.dist-info
-rw-r--r--   1 lessa  1896053708    34K 20 Jul 08:53 six.py
drwxr-xr-x   7 lessa  1896053708   224B 20 Jul 08:53 typing_extensions-4.3.0.dist-info
-rw-r--r--   1 lessa  1896053708    74K 20 Jul 08:53 typing_extensions.py
drwxr-xr-x  17 lessa  1896053708   544B 20 Jul 08:53 urllib3
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 urllib3-1.26.10.dist-info
drwxr-xr-x   9 lessa  1896053708   288B 20 Jul 08:53 wrapt
drwxr-xr-x   8 lessa  1896053708   256B 20 Jul 08:53 wrapt-1.14.1.dist-info

@heitorlessa heitorlessa merged commit a1fda40 into aws-powertools:develop Jul 20, 2022
@heitorlessa heitorlessa deleted the fix/mypy-type-dev-dep branch July 20, 2022 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants