diff --git a/installer/pyinstaller/hook-samcli.py b/installer/pyinstaller/hook-samcli.py index 4c9cec671d..ca0ebafc63 100644 --- a/installer/pyinstaller/hook-samcli.py +++ b/installer/pyinstaller/hook-samcli.py @@ -13,6 +13,9 @@ )[0] + hooks.collect_all("jschema_to_python", include_py_files=False)[0] + hooks.collect_all("cfnlint", include_py_files=True)[0] + # cookiecutter 2.2.3 added the version in a file called VERSION.txt which needs to be added + # for sam init to run cookiecutter using pyinstaller https://github.com/cookiecutter/cookiecutter/releases/tag/2.2.3 + + hooks.collect_all("cookiecutter", include_py_files=False)[0] # Collect ONLY data files. + hooks.collect_data_files("samcli") + hooks.collect_data_files("samtranslator") diff --git a/requirements/base.txt b/requirements/base.txt index 06abc9a939..fbd0a267b5 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -5,7 +5,7 @@ boto3>=1.26.109,<2 jmespath~=1.0.1 ruamel_yaml~=0.17.32 PyYAML~=6.0,>=6.0.1 -cookiecutter~=2.1.1 +cookiecutter~=2.3.0 aws-sam-translator==1.75.0 #docker minor version updates can include breaking changes. Auto update micro version only. docker~=6.1.0 diff --git a/requirements/reproducible-linux.txt b/requirements/reproducible-linux.txt index 48decd3e88..3318c2922f 100644 --- a/requirements/reproducible-linux.txt +++ b/requirements/reproducible-linux.txt @@ -11,7 +11,7 @@ annotated-types==0.5.0 \ arrow==1.2.3 \ --hash=sha256:3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1 \ --hash=sha256:5a49ab92e3b7b71d96cd6bfcc4df14efefc9dfa96ea19045815914a6ab6b1fe2 - # via jinja2-time + # via cookiecutter attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 @@ -224,9 +224,9 @@ click==8.1.7 \ # aws-sam-cli (setup.py) # cookiecutter # flask -cookiecutter==2.1.1 \ - --hash=sha256:9f3ab027cec4f70916e28f03470bdb41e637a3ad354b4d65c765d93aad160022 \ - --hash=sha256:f3982be8d9c53dac1261864013fdec7f83afd2e42ede6f6dd069c5e149c540d5 +cookiecutter==2.3.0 \ + --hash=sha256:7e87944757c6e9f8729cf89a4139b6a35ab4d6dcbc6ae3e7d6360d44ad3ad383 \ + --hash=sha256:942a794981747f6d7f439d6e49d39dc91a9a641283614160c93c474c72c29621 # via aws-sam-cli (setup.py) cryptography==41.0.4 \ --hash=sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67 \ @@ -279,11 +279,6 @@ jinja2==3.1.2 \ # via # cookiecutter # flask - # jinja2-time -jinja2-time==0.2.0 \ - --hash=sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40 \ - --hash=sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa - # via cookiecutter jmespath==1.0.1 \ --hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \ --hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe @@ -743,7 +738,9 @@ requests==2.31.0 \ rich==13.5.3 \ --hash=sha256:87b43e0543149efa1253f485cd845bb7ee54df16c9617b8a893650ab84b4acb6 \ --hash=sha256:9257b468badc3d347e146a4faa268ff229039d4c2d176ab0cffb4c4fbc73d5d9 - # via aws-sam-cli (setup.py) + # via + # aws-sam-cli (setup.py) + # cookiecutter rpds-py==0.10.3 \ --hash=sha256:015de2ce2af1586ff5dc873e804434185199a15f7d96920ce67e50604592cae9 \ --hash=sha256:061c3ff1f51ecec256e916cf71cc01f9975af8fb3af9b94d3c0cc8702cfea637 \ diff --git a/requirements/reproducible-mac.txt b/requirements/reproducible-mac.txt index 5905978846..31b83dfabf 100644 --- a/requirements/reproducible-mac.txt +++ b/requirements/reproducible-mac.txt @@ -11,7 +11,7 @@ annotated-types==0.5.0 \ arrow==1.2.3 \ --hash=sha256:3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1 \ --hash=sha256:5a49ab92e3b7b71d96cd6bfcc4df14efefc9dfa96ea19045815914a6ab6b1fe2 - # via jinja2-time + # via cookiecutter attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 @@ -242,9 +242,9 @@ click==8.1.7 \ # aws-sam-cli (setup.py) # cookiecutter # flask -cookiecutter==2.1.1 \ - --hash=sha256:9f3ab027cec4f70916e28f03470bdb41e637a3ad354b4d65c765d93aad160022 \ - --hash=sha256:f3982be8d9c53dac1261864013fdec7f83afd2e42ede6f6dd069c5e149c540d5 +cookiecutter==2.3.0 \ + --hash=sha256:7e87944757c6e9f8729cf89a4139b6a35ab4d6dcbc6ae3e7d6360d44ad3ad383 \ + --hash=sha256:942a794981747f6d7f439d6e49d39dc91a9a641283614160c93c474c72c29621 # via aws-sam-cli (setup.py) cryptography==41.0.4 \ --hash=sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67 \ @@ -307,11 +307,6 @@ jinja2==3.1.2 \ # via # cookiecutter # flask - # jinja2-time -jinja2-time==0.2.0 \ - --hash=sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40 \ - --hash=sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa - # via cookiecutter jmespath==1.0.1 \ --hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \ --hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe @@ -775,7 +770,9 @@ requests==2.31.0 \ rich==13.5.3 \ --hash=sha256:87b43e0543149efa1253f485cd845bb7ee54df16c9617b8a893650ab84b4acb6 \ --hash=sha256:9257b468badc3d347e146a4faa268ff229039d4c2d176ab0cffb4c4fbc73d5d9 - # via aws-sam-cli (setup.py) + # via + # aws-sam-cli (setup.py) + # cookiecutter rpds-py==0.10.3 \ --hash=sha256:015de2ce2af1586ff5dc873e804434185199a15f7d96920ce67e50604592cae9 \ --hash=sha256:061c3ff1f51ecec256e916cf71cc01f9975af8fb3af9b94d3c0cc8702cfea637 \ diff --git a/requirements/reproducible-win.txt b/requirements/reproducible-win.txt index 6c0d9e11b8..8bbc6c6f3e 100644 --- a/requirements/reproducible-win.txt +++ b/requirements/reproducible-win.txt @@ -11,7 +11,7 @@ annotated-types==0.5.0 \ arrow==1.2.3 \ --hash=sha256:3934b30ca1b9f292376d9db15b19446088d12ec58629bc3f0da28fd55fb633a1 \ --hash=sha256:5a49ab92e3b7b71d96cd6bfcc4df14efefc9dfa96ea19045815914a6ab6b1fe2 - # via jinja2-time + # via cookiecutter attrs==23.1.0 \ --hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ --hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 @@ -246,9 +246,9 @@ colorama==0.4.6 \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 # via click -cookiecutter==2.1.1 \ - --hash=sha256:9f3ab027cec4f70916e28f03470bdb41e637a3ad354b4d65c765d93aad160022 \ - --hash=sha256:f3982be8d9c53dac1261864013fdec7f83afd2e42ede6f6dd069c5e149c540d5 +cookiecutter==2.3.0 \ + --hash=sha256:7e87944757c6e9f8729cf89a4139b6a35ab4d6dcbc6ae3e7d6360d44ad3ad383 \ + --hash=sha256:942a794981747f6d7f439d6e49d39dc91a9a641283614160c93c474c72c29621 # via aws-sam-cli (setup.py) cryptography==41.0.4 \ --hash=sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67 \ @@ -311,11 +311,6 @@ jinja2==3.1.2 \ # via # cookiecutter # flask - # jinja2-time -jinja2-time==0.2.0 \ - --hash=sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40 \ - --hash=sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa - # via cookiecutter jmespath==1.0.1 \ --hash=sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980 \ --hash=sha256:90261b206d6defd58fdd5e85f478bf633a2901798906be2ad389150c5c60edbe @@ -795,7 +790,9 @@ requests==2.31.0 \ rich==13.5.3 \ --hash=sha256:87b43e0543149efa1253f485cd845bb7ee54df16c9617b8a893650ab84b4acb6 \ --hash=sha256:9257b468badc3d347e146a4faa268ff229039d4c2d176ab0cffb4c4fbc73d5d9 - # via aws-sam-cli (setup.py) + # via + # aws-sam-cli (setup.py) + # cookiecutter rpds-py==0.10.3 \ --hash=sha256:015de2ce2af1586ff5dc873e804434185199a15f7d96920ce67e50604592cae9 \ --hash=sha256:061c3ff1f51ecec256e916cf71cc01f9975af8fb3af9b94d3c0cc8702cfea637 \ diff --git a/samcli/cli/hidden_imports.py b/samcli/cli/hidden_imports.py index 2d116d9fc8..770c92a7a1 100644 --- a/samcli/cli/hidden_imports.py +++ b/samcli/cli/hidden_imports.py @@ -22,7 +22,6 @@ def walk_modules(module: ModuleType, visited: set) -> None: SAM_CLI_HIDDEN_IMPORTS = list(samcli_modules) + [ "cookiecutter.extensions", - "jinja2_time", "text_unidecode", "samtranslator", # default hidden import 'pkg_resources.py2_warn' is added diff --git a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json b/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json index 0c7df72a51..cdb156b544 100644 --- a/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json +++ b/tests/functional/testdata/init/unknown_runtime/python3.8/cookiecutter-aws-sam-hello/cookiecutter.json @@ -2,6 +2,8 @@ "project_name": "Name of the project", "runtime": "unknown", "architectures": { - "value": [] + "value": [ + "x86_64", "arm64" + ] } } \ No newline at end of file diff --git a/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/cookiecutter.json b/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/cookiecutter.json index 0c7df72a51..51d1dfa1de 100644 --- a/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/cookiecutter.json +++ b/tests/functional/testdata/init/unknown_runtime/random.runtime1/cookiecutter-aws-sam-hello/cookiecutter.json @@ -2,6 +2,6 @@ "project_name": "Name of the project", "runtime": "unknown", "architectures": { - "value": [] + "value": ["x86_64", "arm64"] } } \ No newline at end of file diff --git a/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/cookiecutter.json b/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/cookiecutter.json index 0c7df72a51..51d1dfa1de 100644 --- a/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/cookiecutter.json +++ b/tests/functional/testdata/init/unknown_runtime/random.runtime2/cookiecutter-aws-sam-hello/cookiecutter.json @@ -2,6 +2,6 @@ "project_name": "Name of the project", "runtime": "unknown", "architectures": { - "value": [] + "value": ["x86_64", "arm64"] } } \ No newline at end of file