Remove botocore and install requests directly#2
Remove botocore and install requests directly#2brysontyrrell wants to merge 1 commit intogene1wood:masterfrom
Conversation
|
Is there anything stopping this being merged in? This module is now broken since it does not set the botocore version, meaning it downloads the latest version of botocore which no longer has Requests bundled in. Workaround: download an earlier version of botocore (1.12.253 should work) which still has requests bundled in. This forces cfnresponse to use your version rather than the latest |
|
Any updates? this module is now broken unless you downgrade boto3/botocore |
|
We're now seeing this error now when using |
|
Is this actually the version that AWS uses? Getting this merged is one thing but getting it deployed to inside of AWS so that Lambda Functions respond is another. |
|
Ya, the challenge is that without any dependent modules ats @m8786 points out, deploying and using this is simple. If this module begins to depend on Given that it sounds like |
|
Thank you, Gene. Appreciate it! |
|
I believe in all cases this module is I’m only being installed via |
|
So it looks like as of today in the Python 2.7 lambda environment the vendored requests is still available where it was at The current Python 3.6 and 3.7 lambda environments make the package available at Details on what modules are present in the various environments
So I can understand the problem better, how are you using
Are you using
Is this using the version of Just trying to get some details about the problem. |
|
When installed via But pinning to an old version isn’t a solution. We would want to move away from using a vendored package. |
|
@gene1wood FYI: I'm using the documentation stated here: Which means there's very little management of that function itself. AWS' own documentation states to use that when using the ZipFile property. Even if this fix worked, we're not the ones deploying the package, that's AWS. |
|
The error I posted is in Lambdas where we are installing the package alongside other requirements. At some point, though, the Lambda environments will be updated to a version of boto3/botocore that breaks the existing package. |
|
Let me see if I can make a PR that replaces requests with native python functions since it's just a simple PUT, that'll work around this problem |
|
Ya it looks like this should be doable using I'll see if I can do this tomorrow. |
|
@gene1wood yes, we were doing that. now, pinning to the last version of botocore that has requests included. and then pinning boto3 too |
|
Shoot, The intent of this repo was to make the AWS You can see in the README that I show a method to validate that the code in this module is byte for byte identical to AWS's actual So the problem is this. I can't go and change this module because the point is to mirror AWS's code. The problem with the deprecated (but working) use of the vendored So depending on what you use this mirror for I'd offer different suggestions
If you have a different use case than these two, let me know and I'll add that into the list. I've merged and deployed #3 which ensures that |
|
I think at this point we can safely mirror AWS's code by using urllib3. Example: #4 |
|
@twillowman is correct, AWS now uses |
Importing
requestsfrombotocoreresults inDeprecationWarningmessages.requestshas not been maintained as a vendored package within the module for some time and will be removed at some point in the future (it still exists only for compatibility purposes).This PR switching the installation requirement away from
botocoretorequestsand updated the code to import that module directly.See: aws-cloudformation/aws-cloudformation-templates#196