Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why This Is Needed
Hooks that define a global variable when imported that relies on an environment variable set by Runway (e.g.
AWS_DEFAULT_REGION
) will retain its original value across uses.While this is the appropriate functionally from a python standpoint and should be expected, historically this functioned differently do to the use of
subprocess.Popen
being used to invoke the stacker cli. This created a different process for each region allowing the global values to change.If merged, this change should be considered for removal in the next major release so that the global variables function as expected.
What Changed
Added
try_reload
option torunway.util.load_object_from_string
that will useimportlib.reload
to reimport a module if it has already been imported and is not a builtin moduleFixed
>1.5.0