Merge pull request #243184 from ianliu/master

authored by Artturi and committed by GitHub 511dd75c 25488b9e

+21 -77
+21 -37
pkgs/development/tools/aws-sam-cli/default.nix
··· 6 6 7 7 python3.pkgs.buildPythonApplication rec { 8 8 pname = "aws-sam-cli"; 9 - version = "1.53.0"; 9 + version = "1.90.0"; 10 10 11 11 src = fetchPypi { 12 12 inherit pname version; 13 - hash = "sha256-kIW+aGYuS+JgOMsPbeLgPSgLFNKLSqHaZ1CHpjs/IVI="; 13 + hash = "sha256-JXUfc37O6cTTOCTTtWE05m+GR4iDyBsmRPyXoTRxFmo="; 14 14 }; 15 15 16 16 propagatedBuildInputs = with python3.pkgs; [ 17 17 aws-lambda-builders 18 18 aws-sam-translator 19 + boto3 20 + cfn-lint 19 21 chevron 20 - click 21 22 cookiecutter 22 23 dateparser 23 - python-dateutil 24 24 docker 25 25 flask 26 - jmespath 27 - requests 26 + pyopenssl 27 + pyyaml 28 + rich 29 + ruamel-yaml 28 30 serverlessrepo 29 31 tomlkit 32 + typing-extensions 33 + tzlocal 30 34 watchdog 31 - typing-extensions 32 - regex 33 35 ]; 34 36 35 37 postFixup = if enableTelemetry then "echo aws-sam-cli TELEMETRY IS ENABLED" else '' ··· 37 39 wrapProgram $out/bin/sam --set SAM_CLI_TELEMETRY 0 38 40 ''; 39 41 40 - patches = [ 41 - # Click 8.1 removed `get_terminal_size`, recommending 42 - # `shutil.get_terminal_size` instead. 43 - # (https://github.com/pallets/click/pull/2130) 44 - ./support-click-8-1.patch 45 - # Werkzeug >= 2.1.0 breaks the `sam local start-lambda` command because 46 - # aws-sam-cli uses a "WERKZEUG_RUN_MAIN" hack to suppress flask output. 47 - # (https://github.com/cs01/gdbgui/issues/425) 48 - ./use_forward_compatible_log_silencing.patch 49 - ]; 50 - 51 - # fix over-restrictive version bounds 52 42 postPatch = '' 53 43 substituteInPlace requirements/base.txt \ 54 - --replace "aws_lambda_builders==" "aws-lambda-builders #" \ 55 - --replace "aws-sam-translator==1.46.0" "aws-sam-translator~=1.46" \ 56 - --replace "click~=7.1" "click~=8.1" \ 57 - --replace "cookiecutter~=1.7.2" "cookiecutter>=1.7.2" \ 58 - --replace "dateparser~=1.0" "dateparser>=0.7" \ 59 - --replace "docker~=4.2.0" "docker>=4.2.0" \ 60 - --replace "Flask~=1.1.4" "Flask~=2.0" \ 61 - --replace "jmespath~=0.10.0" "jmespath" \ 62 - --replace "MarkupSafe==2.0.1" "MarkupSafe #" \ 63 - --replace "PyYAML~=5.3" "PyYAML #" \ 64 - --replace "regex==" "regex #" \ 65 - --replace "requests==" "requests #" \ 66 - --replace "typing_extensions==" "typing-extensions #" \ 67 - --replace "tzlocal==3.0" "tzlocal #" \ 68 - --replace "tomlkit==0.7.2" "tomlkit #" \ 69 - --replace "watchdog==" "watchdog #" 44 + --replace 'PyYAML>=' 'PyYAML>=5.4.1 #' \ 45 + --replace 'aws-sam-translator==1.70.0' 'aws-sam-translator>=1.60.1' \ 46 + --replace 'boto3>=' 'boto3>=1.26.79 #' \ 47 + --replace 'cfn-lint~=0.77.9' 'cfn-lint~=0.73.2' \ 48 + --replace 'docker~=6.1.0' 'docker~=6.0.1' \ 49 + --replace 'pyopenssl~=23.2.0' 'pyopenssl~=23.1.0' \ 50 + --replace 'ruamel_yaml~=0.17.32' 'ruamel_yaml~=0.17.21' \ 51 + --replace 'tomlkit==0.11.8' 'tomlkit~=0.11.6' \ 52 + --replace 'typing_extensions~=4.4.0' 'typing_extensions~=4.4' \ 53 + --replace 'tzlocal==3.0' 'tzlocal>=3.0' \ 54 + --replace 'watchdog==' 'watchdog>=2.1.2 #' 70 55 ''; 71 56 72 - # Tests are not included in the PyPI package 73 57 doCheck = false; 74 58 75 59 meta = with lib; {
-21
pkgs/development/tools/aws-sam-cli/support-click-8-1.patch
··· 1 - diff --git a/samcli/commands/_utils/table_print.py b/samcli/commands/_utils/table_print.py 2 - index de63af29..a9d0f2fe 100644 3 - --- a/samcli/commands/_utils/table_print.py 4 - +++ b/samcli/commands/_utils/table_print.py 5 - @@ -7,6 +7,7 @@ from functools import wraps 6 - from typing import Sized 7 - 8 - import click 9 - +import shutil 10 - 11 - MIN_OFFSET = 20 12 - 13 - @@ -30,7 +31,7 @@ def pprint_column_names( 14 - 15 - def pprint_wrap(func): 16 - # Calculate terminal width, number of columns in the table 17 - - width, _ = click.get_terminal_size() 18 - + width, _ = shutil.get_terminal_size() 19 - # For UX purposes, set a minimum width for the table to be usable 20 - # and usable_width keeps margins in mind. 21 - width = max(width, min_width)
-19
pkgs/development/tools/aws-sam-cli/use_forward_compatible_log_silencing.patch
··· 1 - diff --git a/samcli/local/services/base_local_service.py b/samcli/local/services/base_local_service.py 2 - index 7b1ab95895d1..76812f02e00a 100644 3 - --- a/samcli/local/services/base_local_service.py 4 - +++ b/samcli/local/services/base_local_service.py 5 - @@ -56,9 +56,11 @@ class BaseLocalService: 6 - 7 - LOG.debug("Localhost server is starting up. Multi-threading = %s", multi_threaded) 8 - 9 - - # This environ signifies we are running a main function for Flask. This is true, since we are using it within 10 - - # our cli and not on a production server. 11 - - os.environ["WERKZEUG_RUN_MAIN"] = "true" 12 - + # Suppress flask dev server output in a forward-compatible way 13 - + # Source: https://github.com/cs01/gdbgui/issues/425#issuecomment-1119836533 14 - + import flask.cli 15 - + 16 - + flask.cli.show_server_banner = lambda *args: None 17 - 18 - self._app.run(threaded=multi_threaded, host=self.host, port=self.port) 19 -