Skip to content

Commit ee86b48

Browse files
authored
Uncomment cryptography dependency in Python build test fixtures (aws#8735)
* Uncomment cryptography dependency with Lambda-compatible version * Add cryptography to CDK asset requirements.txt
1 parent 0963a2b commit ee86b48

22 files changed

Lines changed: 33 additions & 56 deletions

File tree

tests/integration/buildcmd/build_integ_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ class BuildIntegPythonBase(BuildIntegBase):
746746
"__init__.py",
747747
"main.py",
748748
"numpy",
749-
# 'cryptography',
749+
"cryptography",
750750
}
751751

752752
FUNCTION_LOGICAL_ID = "Function"

tests/integration/buildcmd/test_build_cmd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ class TestBuildCommand_SingleFunctionBuilds(BuildIntegBase):
398398
"__init__.py",
399399
"main.py",
400400
"numpy",
401-
# 'cryptography',
401+
"cryptography",
402402
"requirements.txt",
403403
}
404404

@@ -1763,7 +1763,7 @@ class TestBuildWithNestedStacksImage(NestedBuildIntegBase):
17631763
"__init__.py",
17641764
"main.py",
17651765
"numpy",
1766-
# 'cryptography',
1766+
"cryptography",
17671767
"requirements.txt",
17681768
}
17691769

@@ -1937,7 +1937,7 @@ class TestBuildWithS3FunctionsOrLayers(NestedBuildIntegBase):
19371937
"__init__.py",
19381938
"main.py",
19391939
"numpy",
1940-
# 'cryptography',
1940+
"cryptography",
19411941
"requirements.txt",
19421942
}
19431943

tests/integration/testdata/buildcmd/PyLayer/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
# NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600)
44
numpy<1.20.3; python_version < '3.10'
55
numpy==1.26.4; python_version >= '3.10'
6-
# `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container.
7-
# Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29
8-
# cryptography~=2.4
6+
cryptography==3.3.2

tests/integration/testdata/buildcmd/PyLayerMake/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
# NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600)
44
numpy<1.20.3; python_version < '3.10'
55
numpy==1.26.4; python_version >= '3.10'
6-
# `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container.
7-
# Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29
8-
# cryptography~=2.4
6+
cryptography==3.3.2

tests/integration/testdata/buildcmd/Python/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import numpy
22

3-
4-
# from cryptography.fernet import Fernet
3+
from cryptography.fernet import Fernet
54

65

76
def handler(event, context):
87
# Try using some of the modules to make sure they work & don't crash the process
9-
# print(Fernet.generate_key())
8+
print(Fernet.generate_key())
109

1110
return {"pi": "{0:.2f}".format(numpy.pi)}
1211

tests/integration/testdata/buildcmd/Python/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
numpy<1.20.3; python_version <= '3.9'
55
numpy==2.1.3; python_version >= '3.10' and python_version < '3.14'
66
numpy==2.3.4; python_version >= '3.14'
7-
# `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container.
8-
# Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29
9-
# cryptography~=2.4
7+
cryptography==3.3.2
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# These are some hard packages to build. Using them here helps us verify that building works on various platforms
2+
3+
# NOTE: Fixing to <1.20.3 as numpy1.20.3 started to use a new wheel naming convention (PEP 600)
4+
numpy<1.20.3; python_version <= '3.9'
5+
numpy==2.1.3; python_version >= '3.10' and python_version < '3.14'
6+
numpy==2.3.4; python_version >= '3.14'
7+
cryptography==3.3.2

tests/integration/testdata/buildcmd/PythonImage/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
numpy<1.20.3; python_version < '3.10'
55
numpy==2.1.3; python_version >= '3.10' and python_version < '3.14'
66
numpy==2.3.4; python_version >= '3.14'
7-
# `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container.
8-
# Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29
9-
# cryptography~=2.4
7+
cryptography==3.3.2

tests/integration/testdata/buildcmd/PythonImagesWithSharedCode/requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44
numpy<1.20.3; python_version < '3.10'
55
numpy==2.1.3; python_version >= '3.10' and python_version < '3.14'
66
numpy==2.3.4; python_version >= '3.14'
7-
# `cryptography` has a dependency on `pycparser` which, for some reason doesn't build inside a Docker container.
8-
# Turning this off until we resolve this issue: https://github.com/awslabs/aws-lambda-builders/issues/29
9-
# cryptography~=2.4
7+
cryptography==3.3.2

tests/integration/testdata/buildcmd/PythonPEP600/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ numpy==2.3.4; python_version >= '3.14'
77
greenlet==3.1.1; python_version < '3.14'
88
greenlet==3.2.4; python_version >= '3.14'
99
sqlalchemy==2.0.36
10+
cryptography==3.3.2

0 commit comments

Comments
 (0)