aws-sam-cli: 1.37.0 -> 1.52.0

main
Luke Worth 2 years ago
parent 4618729d68
commit b1cc6afe11
  1. 14
      pkgs/development/tools/aws-sam-cli/default.nix
  2. 21
      pkgs/development/tools/aws-sam-cli/support-click-8-1.patch

@ -5,11 +5,11 @@
python3.pkgs.buildPythonApplication rec {
pname = "aws-sam-cli";
version = "1.37.0";
version = "1.52.0";
src = python3.pkgs.fetchPypi {
inherit pname version;
hash = "sha256-XE3g2mKwAiaJvi0ShVScnCKrmz7ujaQgOeFXuYwtP4g=";
hash = "sha256-ldr0X+I5+Nfb+WBDOe0m202WOuccGUI5HFL3fpbBNPo=";
};
propagatedBuildInputs = with python3.pkgs; [
@ -36,15 +36,23 @@ python3.pkgs.buildPythonApplication rec {
wrapProgram $out/bin/sam --set SAM_CLI_TELEMETRY 0
'';
patches = [
# Click 8.1 removed `get_terminal_size`, recommending
# `shutil.get_terminal_size` instead.
# (https://github.com/pallets/click/pull/2130)
./support-click-8-1.patch
];
# fix over-restrictive version bounds
postPatch = ''
substituteInPlace requirements/base.txt \
--replace "aws_lambda_builders==" "aws-lambda-builders #" \
--replace "click~=7.1" "click~=8.0" \
--replace "click~=7.1" "click~=8.1" \
--replace "dateparser~=1.0" "dateparser>=0.7" \
--replace "docker~=4.2.0" "docker>=4.2.0" \
--replace "Flask~=1.1.2" "Flask~=2.0" \
--replace "jmespath~=0.10.0" "jmespath" \
--replace "MarkupSafe==2.0.1" "MarkupSafe #" \
--replace "PyYAML~=5.3" "PyYAML #" \
--replace "regex==" "regex #" \
--replace "requests==" "requests #" \

@ -0,0 +1,21 @@
diff --git a/samcli/commands/_utils/table_print.py b/samcli/commands/_utils/table_print.py
index de63af29..a9d0f2fe 100644
--- a/samcli/commands/_utils/table_print.py
+++ b/samcli/commands/_utils/table_print.py
@@ -7,6 +7,7 @@ from functools import wraps
from typing import Sized
import click
+import shutil
MIN_OFFSET = 20
@@ -30,7 +31,7 @@ def pprint_column_names(
def pprint_wrap(func):
# Calculate terminal width, number of columns in the table
- width, _ = click.get_terminal_size()
+ width, _ = shutil.get_terminal_size()
# For UX purposes, set a minimum width for the table to be usable
# and usable_width keeps margins in mind.
width = max(width, min_width)
Loading…
Cancel
Save