From 9269664f7e75b0c507474938c5c64f84db4e2e19 Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Sun, 17 Dec 2023 21:36:03 +1100 Subject: [PATCH 1/3] Remove removed_in version of role_arn This removes the removed_in version of role_arn, iam_role and iam_role_session_duration, to give consumers more time to upgrade. --- sceptre/stack.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sceptre/stack.py b/sceptre/stack.py index 838136448..c846e7971 100644 --- a/sceptre/stack.py +++ b/sceptre/stack.py @@ -146,14 +146,23 @@ class Stack: hooks = HookProperty("hooks") iam_role = create_deprecated_alias_property( - "iam_role", "sceptre_role", "4.0.0", "5.0.0" + "iam_role", + "sceptre_role", + deprecated_in="4.0.0", + removed_in=None, ) role_arn = create_deprecated_alias_property( - "role_arn", "cloudformation_service_role", "4.0.0", "5.0.0" + "role_arn", + "cloudformation_service_role", + deprecated_in="4.0.0", + removed_in=None, ) sceptre_role_session_duration = None iam_role_session_duration = create_deprecated_alias_property( - "iam_role_session_duration", "sceptre_role_session_duration", "4.0.0", "5.0.0" + "iam_role_session_duration", + "sceptre_role_session_duration", + deprecated_in="4.0.0", + removed_in=None, ) def __init__( From 066580c82c7d955a5017e1ef150531586cc2af7e Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Thu, 18 Jan 2024 22:50:03 +1100 Subject: [PATCH 2/3] Also remove deprecation for template_path --- sceptre/stack.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sceptre/stack.py b/sceptre/stack.py index 3b2dff357..37398ee5f 100644 --- a/sceptre/stack.py +++ b/sceptre/stack.py @@ -42,7 +42,7 @@ class Stack: :param template_path: The relative path to the CloudFormation, Jinja2, or Python template to build the Stack from. If this is filled, `template_handler_config` should not be filled. This field has been deprecated since - version 4.0.0 and will be removed in version 5.0.0. + version 4.0.0 and will be removed eventually. :param template_handler_config: Configuration for a Template Handler that can resolve its arguments to a template string. Should contain the `type` property to specify @@ -92,15 +92,15 @@ class Stack: :param iam_role: The ARN of a role for Sceptre to assume before interacting with the environment. If not supplied, Sceptre uses the user's AWS CLI - credentials. This field has been deprecated since version 4.0.0 and will be removed in - version 5.0.0. + credentials. This field has been deprecated since version 4.0.0 and will be removed + eventually. :param sceptre_role: The ARN of a role for Sceptre to assume before interacting\ with the environment. If not supplied, Sceptre uses the user's AWS CLI\ credentials. :param iam_role_session_duration: The duration in seconds of the assumed IAM role session. - This field has been deprecated since version 4.0.0 and will be removed in version 5.0.0. + This field has been deprecated since version 4.0.0 and will be removed eventually. :param sceptre_role_session_duration: The duration in seconds of the assumed IAM role session. @@ -395,19 +395,12 @@ def template(self): ) return self._template - @property - @deprecated( - "4.0.0", "5.0.0", __version__, "Use the template Stack Config key instead." - ) - def template_path(self) -> str: - """The path argument from the template_handler config. This field is deprecated as of v4.0.0 - and will be removed in v5.0.0. - """ - return self.template_handler_config["path"] - @template_path.setter @deprecated( - "4.0.0", "5.0.0", __version__, "Use the template Stack Config key instead." + deprecated_in="4.0.0", + removed_in=None, + current_version=__version__, + details="Use the template Stack Config key instead." ) def template_path(self, value: str): self.template_handler_config = {"type": "file", "path": value} From 25052a100814e9a9ec6b24eaf619047af91a3101 Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Fri, 19 Jan 2024 11:07:48 +1100 Subject: [PATCH 3/3] more --- sceptre/stack.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sceptre/stack.py b/sceptre/stack.py index 37398ee5f..8a633096c 100644 --- a/sceptre/stack.py +++ b/sceptre/stack.py @@ -395,12 +395,25 @@ def template(self): ) return self._template + @property + @deprecated( + deprecated_in="4.0.0", + removed_in=None, + current_version=__version__, + details="Use the template Stack Config key instead.", + ) + def template_path(self) -> str: + """The path argument from the template_handler config. This field is deprecated as of v4.0.0 + and will be removed in v5.0.0. + """ + return self.template_handler_config["path"] + @template_path.setter @deprecated( deprecated_in="4.0.0", removed_in=None, current_version=__version__, - details="Use the template Stack Config key instead." + details="Use the template Stack Config key instead.", ) def template_path(self, value: str): self.template_handler_config = {"type": "file", "path": value}