-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Deploying with cryptography package (in pywebpush) in Python 3.7 #1106
Comments
Can you share the steps you tried? This should just work. I'm not seeing any issues when I try to package both pywebpush and the specific version of cryptography in your description. Here's what I tried:
Can you confirm you're using the latest version of chalice? |
That's really strange then, I tried the exact same steps as you did, I created a new project and everything but I still get the
This is my version of Chalice and AWS-CLI:
I've tried building various versions of the pywebpush and cryptography in the Amazon Linux 2 instance, to no avail. |
Is there any alternate way of ensuring that the dependency is added? pyywebpush is a perfect fit for our use case and it would suck to have to remove it/find something else. |
@jamesls Sorry for badgering you, but I would really appreciate your assistance (am I supposed to @ you when posting a follow up comment?). Does the platform you sit on when packaging it matter? I'm sitting on Windows 10, do you need to do it on linux instead? I've tried using Python 3.7.0 instead of 3.7.2, but that made no difference |
Ok, so I'm not entirely sure about what I did differently this time, but after building the cryptography wheel in the Amazon Linux 2 instance and unpacking it to the vendor folder, with the dependencies listed for cryptography (cffi, pycparser, six, asn1crypto) + pywebpush, it somehow worked. I apologise for my badgering, and I'll close this issue. |
So I've encountered an issue when trying to deploy while using the pywebpush package. When I deploy I receive this error:
And when trying to execute the Lambda it complains that it couldn't import the cryptography module. To note, when running it with chalice local everything works as expected, it's only on the deploy that things start to go wrong.
After looking into it a bit, I've discovered that the cryptography package in particular causes problems, though according to the docs it should have been fixed after 2.0.0 was released. I then discovered that later releases of it started causing issues again: #764
So I then looked into the docs regarding how to manually add it to the vendor folder, though I encountered another problem with that. According to the documentation, one is supposed to go into a Amazon Linux EC2 instance and follow the instructions. However, apparently they don't support Python 3.7.
So I'm a bit confused with how I should approach this.
Edit:
So I've solved one part of the issue, I managed to set up an Amazon Linux 2 EC2 instance (instead of regular Amazon Linux), which supports Python 3.7. As such I was able to build the wheel for cryptography 2.1.4 (according to #764 that was the last functioning version). However, when using this I encountered an error as pywebpush relies on, at the very least, cryptography 2.5.0. Specifically, they added an X962 encoding which doesn't work.
I will try to build a wheel for various versions of pywebpush and cryptography, though things seem grim at the moment.
The text was updated successfully, but these errors were encountered: