powertools-lambda-python: Bug: JMESPath semantic version mismatch with boto3

Expected Behaviour

I should be able to install an unpinned version of boto3 and aws-lambda-powertools without a dependency error

Current Behaviour

Installing boto3 and aws-lambda-powertools==1.25.7 results in the following error message during installation.

aws-lambda-powertools 1.25.7 requires jmespath<0.11.0,>=0.10.0, but you'll have jmespath 1.0.0 which is incompatible.

Code snippet

N/A

Possible Solution

boto3 added support for JMESPath 1.0 in this PR: https://github.com/boto/boto3/pull/3189. Didn’t appear to require any code changes, just opening up the allowable versions to something less than 2.0

Steps to Reproduce

cat requirements.txt wheel boto3 aws-lambda-powertools[pydantic]==1.25.7

pip install -r requirements.txt

AWS Lambda Powertools for Python version

1.25.7

AWS Lambda function runtime

3.9

Packaging format used

PyPi

Debugging logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (14 by maintainers)

Most upvoted comments

1.25.9 is now out. @corey-cole @michaelbrewer could you give that a try please? Tested in Lambda runtime, locally, and Layers build sandbox

jmespath = [
  { version ="<=0.10.0", python = "^3.6" },
  { version ="^1.0.0", python = "^3.7" }
]

@corey-cole a possible solution can be made ie: https://github.com/awslabs/aws-lambda-powertools-python/pull/1139

@heitorlessa works for me with the following test case:

requirements.txt :

boto3
jmespath==1.0.0
aws-lambda-powertools==1.25.9

Shell output:

(.venv) ➜  xx pip install -r requirements.txt    
Collecting boto3
  Using cached boto3-1.21.44-py3-none-any.whl (132 kB)
Collecting jmespath==1.0.0
  Using cached jmespath-1.0.0-py3-none-any.whl (23 kB)
Collecting aws-lambda-powertools==1.25.9
  Using cached aws_lambda_powertools-1.25.9-py3-none-any.whl (171 kB)
Collecting fastjsonschema<3.0.0,>=2.14.5
  Using cached fastjsonschema-2.15.3-py3-none-any.whl (22 kB)
Collecting aws-xray-sdk<3.0.0,>=2.8.0
  Using cached aws_xray_sdk-2.9.0-py2.py3-none-any.whl (98 kB)
Collecting s3transfer<0.6.0,>=0.5.0
  Using cached s3transfer-0.5.2-py3-none-any.whl (79 kB)
Collecting botocore<1.25.0,>=1.24.44
  Using cached botocore-1.24.44-py3-none-any.whl (8.7 MB)
Collecting wrapt
  Using cached wrapt-1.14.0-cp39-cp39-macosx_11_0_arm64.whl (35 kB)
Collecting future
  Using cached future-0.18.2-py3-none-any.whl
Collecting urllib3<1.27,>=1.25.4
  Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: fastjsonschema, wrapt, urllib3, six, jmespath, future, python-dateutil, botocore, s3transfer, aws-xray-sdk, boto3, aws-lambda-powertools
Successfully installed aws-lambda-powertools-1.25.9 aws-xray-sdk-2.9.0 boto3-1.21.44 botocore-1.24.44 fastjsonschema-2.15.3 future-0.18.2 jmespath-1.0.0 python-dateutil-2.8.2 s3transfer-0.5.2 six-1.16.0 urllib3-1.26.9 wrapt-1.14.0
(.venv) ➜  xx pip list
Package               Version
--------------------- -------
aws-lambda-powertools 1.25.9
aws-xray-sdk          2.9.0
boto3                 1.21.44
botocore              1.24.44
fastjsonschema        2.15.3
future                0.18.2
jmespath              1.0.0
pip                   22.0.4
python-dateutil       2.8.2
s3transfer            0.5.2
setuptools            60.10.0
six                   1.16.0
urllib3               1.26.9
wrapt                 1.14.0

And for completeness only the failing test:

boto3
jmespath==1.0.0
aws-lambda-powertools==1.25.8
(.venv) ➜  xx pip install -r requirements.txt
Requirement already satisfied: boto3 in ./.venv/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.21.44)
Requirement already satisfied: jmespath==1.0.0 in ./.venv/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.0.0)
Collecting aws-lambda-powertools==1.25.8
  Using cached aws_lambda_powertools-1.25.8-py3-none-any.whl (171 kB)
Requirement already satisfied: aws-xray-sdk<3.0.0,>=2.8.0 in ./.venv/lib/python3.9/site-packages (from aws-lambda-powertools==1.25.8->-r requirements.txt (line 3)) (2.9.0)
Requirement already satisfied: fastjsonschema<3.0.0,>=2.14.5 in ./.venv/lib/python3.9/site-packages (from aws-lambda-powertools==1.25.8->-r requirements.txt (line 3)) (2.15.3)
INFO: pip is looking at multiple versions of jmespath to determine which version is compatible with other requirements. This could take a while.
Collecting jmespath==1.0.0
  Using cached jmespath-1.0.0-py3-none-any.whl (23 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 3) and jmespath==1.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested jmespath==1.0.0
    aws-lambda-powertools 1.25.8 depends on jmespath<=0.10.0; python_version >= "3.6" and python_version < "4.0"

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Reverting Michael’s PR by removing the Python 3.6 marker (tiny change), and publishing 1.25.9 shortly