Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template: add_description -> set_description (stratosphere 3.x). #999

Closed
wants to merge 1 commit into from

Conversation

povesma
Copy link

@povesma povesma commented Jul 6, 2021

Description

As stratosphere has been upgraded to 3.0.1 , add_description is deprecated and removed. set_description should be used instead.

GitHub Issues

#998

@@ -2414,7 +2414,7 @@ def create_stack_template(

# build a fresh template
self.cf_template = troposphere.Template()
self.cf_template.add_description("Automatically generated with Zappa")
self.cf_template.set_description("Automatically generated with Zappa")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to update the requirements to force usage of the new troposphere?
If someone is using troposphere==2.7.0, will this still work?

Copy link

@Quidge Quidge Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree that this would break if this PR ran on a deploy that used troposphere==2.7.0. The core issue imo is that troposphere isn't pinned to a version yet Zappa is relying on a version specific api from troposphere. If Zappa had pinned troposphere to 2x initially there wouldn't be a breakage issue.

@povesma would you add a change to the requirements.txt that pins the version of troposphere to a 3x major version?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to keep backwards compatibility why not do something like:

if hasattr(self.cf_template, 'add_description'):
    add_description
elif hasattr(self.cf_template, 'set_description'):
    set_description

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above backwards compatibility change is not needed for troposphere v2.7.x as the change (from v2.4.2 2019-02-02) included both methods (with a deprecation warning on the set_* variant). Of course, the reason for v3.0.0 was to deprecate Python 2.x support and only support Python 3+ in case that factors into zappa's Python version support.

@mcrowson
Copy link
Contributor

#1029 also pins to troposphere version, using that one instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants