Skip to content

Commit ec0e567

Browse files
chore(workflow) Remove deprecated workflow (#8022)
* remove deprecated workflow * fix make issue related to click version * Update reproducibles: update-reproducible-linux-reqs * Update reproducibles: update-reproducible-mac-reqs * Update reproducibles: update-reproducible-win-reqs --------- Co-authored-by: GitHub Action <action@github.com>
1 parent b46994d commit ec0e567

11 files changed

Lines changed: 35 additions & 50 deletions

File tree

.github/workflows/need-attention-label.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
chevron~=0.12
2-
click~=8.1
2+
click==8.1.8
33
Flask<3.2
44
boto3>=1.29.2,<2
55
jmespath~=1.0.1

requirements/reproducible-linux.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ chevron==0.14.0 \
248248
--hash=sha256:87613aafdf6d77b6a90ff073165a61ae5086e21ad49057aa0e53681601800ebf \
249249
--hash=sha256:fbf996a709f8da2e745ef763f482ce2d311aa817d287593a5b990d6d6e4f0443
250250
# via aws-sam-cli (setup.py)
251-
click==8.1.7 \
252-
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
253-
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
251+
click==8.1.8 \
252+
--hash=sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2 \
253+
--hash=sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a
254254
# via
255255
# aws-sam-cli (setup.py)
256256
# cookiecutter

requirements/reproducible-mac.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ chevron==0.14.0 \
248248
--hash=sha256:87613aafdf6d77b6a90ff073165a61ae5086e21ad49057aa0e53681601800ebf \
249249
--hash=sha256:fbf996a709f8da2e745ef763f482ce2d311aa817d287593a5b990d6d6e4f0443
250250
# via aws-sam-cli (setup.py)
251-
click==8.1.7 \
252-
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
253-
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
251+
click==8.1.8 \
252+
--hash=sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2 \
253+
--hash=sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a
254254
# via
255255
# aws-sam-cli (setup.py)
256256
# cookiecutter

requirements/reproducible-win.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ chevron==0.14.0 \
248248
--hash=sha256:87613aafdf6d77b6a90ff073165a61ae5086e21ad49057aa0e53681601800ebf \
249249
--hash=sha256:fbf996a709f8da2e745ef763f482ce2d311aa817d287593a5b990d6d6e4f0443
250250
# via aws-sam-cli (setup.py)
251-
click==8.1.7 \
252-
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
253-
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
251+
click==8.1.8 \
252+
--hash=sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2 \
253+
--hash=sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a
254254
# via
255255
# aws-sam-cli (setup.py)
256256
# cookiecutter

samcli/cli/command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from collections import OrderedDict
88

99
import click
10+
from click import Group
1011

1112
from samcli.cli.formatters import RootCommandHelpTextFormatter
1213
from samcli.cli.root.command_list import SAM_CLI_COMMANDS
@@ -37,7 +38,7 @@
3738
]
3839

3940

40-
class BaseCommand(click.MultiCommand):
41+
class BaseCommand(Group):
4142
"""
4243
Dynamically loads commands. It takes a list of names of Python packages representing the commands, loads
4344
these packages, and initializes them as Click commands. If a command "hello" is available in a Python package
@@ -244,7 +245,7 @@ def list_commands(self, ctx):
244245

245246
def get_command(self, ctx, cmd_name):
246247
"""
247-
Overrides method from ``click.MultiCommand`` that returns Click CLI object for given command name, if found.
248+
Overrides method from ``Group`` that returns Click CLI object for given command name, if found.
248249
249250
:param ctx: Click context
250251
:param cmd_name: Top-level command name

samcli/commands/docs/core/command.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
from typing import List, Optional
77

8-
from click import Command, Context, MultiCommand, style
8+
from click import Command, Context, Group, style
99

1010
from samcli.cli.row_modifiers import RowDefinition
1111
from samcli.commands.docs.command_context import COMMAND_NAME, DocsCommandContext
@@ -90,19 +90,19 @@ def format_options(self, ctx: Context, formatter: DocsCommandHelpTextFormatter):
9090
self.format_sub_commands(formatter)
9191

9292

93-
class DocsSubCommand(MultiCommand):
94-
def __init__(self, command: Optional[List[str]] = None, *args, **kwargs):
93+
class DocsSubCommand(Group):
94+
def __init__(self, command_list: Optional[List[str]] = None, *args, **kwargs):
9595
"""
9696
Constructor for instantiating a sub-command for the docs command
9797
9898
Parameters
9999
----------
100-
command: Optional[List[str]]
100+
command_list: Optional[List[str]]
101101
Optional list of strings representing the fully resolved command name (e.g. ["docs", "local", "invoke"])
102102
"""
103103
super().__init__(*args, **kwargs)
104104
self.docs_command = DocsCommandContext()
105-
self.command = command or self.docs_command.sub_commands
105+
self.command_list = command_list or self.docs_command.sub_commands.copy()
106106
self.command_string = self.docs_command.sub_command_string
107107
self.command_callback = self.docs_command.command_callback
108108

@@ -127,14 +127,19 @@ def get_command(self, ctx: Context, cmd_name: str) -> Command:
127127
or the leaf command to be invoked by the command handler
128128
129129
"""
130-
next_command = self.command.pop(0)
131-
if not self.command:
130+
if not self.command_list:
131+
return None # type: ignore # This is expected by Click's interface
132+
133+
next_command = self.command_list[0]
134+
remaining_commands = self.command_list[1:] if len(self.command_list) > 1 else []
135+
136+
if not remaining_commands:
132137
return DocsBaseCommand(
133138
name=next_command,
134139
short_help=f"Documentation for {self.command_string}",
135140
callback=self.command_callback,
136141
)
137-
return DocsSubCommand(command=self.command)
142+
return DocsSubCommand(command_list=remaining_commands)
138143

139144
def list_commands(self, ctx: Context) -> List[str]:
140145
"""

samcli/commands/local/generate_event/event_generation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import functools
66

77
import click
8+
from click import Group
89

910
from samcli.cli.cli_config_file import ConfigProvider, configuration_option
1011
from samcli.cli.options import debug_option
@@ -13,7 +14,7 @@
1314
from samcli.lib.utils.version_checker import check_newer_version
1415

1516

16-
class ServiceCommand(click.MultiCommand):
17+
class ServiceCommand(Group):
1718
"""
1819
Top level command that defines the service provided
1920
@@ -83,7 +84,7 @@ def list_commands(self, ctx):
8384
return sorted(self.all_cmds.keys())
8485

8586

86-
class EventTypeSubCommand(click.MultiCommand):
87+
class EventTypeSubCommand(Group):
8788
"""
8889
Class that describes the commands underneath a given service type
8990

samcli/local/apigw/local_apigw_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from samcli.lib.providers.provider import Api, Cors
2020
from samcli.lib.telemetry.event import EventName, EventTracker, UsedFeature
2121
from samcli.lib.utils.stream_writer import StreamWriter
22+
from samcli.local.apigw.authorizers.authorizer import Authorizer
2223
from samcli.local.apigw.authorizers.lambda_authorizer import LambdaAuthorizer
2324
from samcli.local.apigw.event_constructor import construct_v1_event, construct_v2_event_http
2425
from samcli.local.apigw.exceptions import (
@@ -652,7 +653,7 @@ def _request_handler(self, **kwargs):
652653
request_origin = request.headers.get("Origin")
653654
cors_headers = Cors.cors_to_headers(self.api.cors, request_origin, route.event_type)
654655

655-
lambda_authorizer = route.authorizer_object
656+
lambda_authorizer: Optional[Authorizer] = route.authorizer_object
656657

657658
# payloadFormatVersion can only support 2 values: "1.0" and "2.0"
658659
# so we want to do strict validation to make sure it has proper value if provided

tests/unit/cli/test_command.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from contextlib import contextmanager
22

3-
import click
4-
3+
from click import Group
54
from unittest import TestCase
65
from unittest.mock import Mock, patch, call
76
from samcli.cli.command import BaseCommand
@@ -59,7 +58,7 @@ def setUp(self):
5958

6059
def test_must_inherit(self):
6160
cmd = BaseCommand()
62-
self.assertTrue(isinstance(cmd, click.MultiCommand))
61+
self.assertTrue(isinstance(cmd, Group))
6362

6463
def test_check_formatter(self):
6564
cmd = BaseCommand()

0 commit comments

Comments
 (0)