ashb commented on a change in pull request #13439:
URL: https://github.com/apache/airflow/pull/13439#discussion_r551396754
##########
File path: setup.py
##########
@@ -640,15 +672,21 @@ def find_requirements_for_alias(alias_to_look_for:
Tuple[str, str]) -> List[str]
raise Exception(f"The extra {new_extra} is missing for alias
{deprecated_extra}")
-# Add extras for all deprecated aliases. Requirements for those deprecated
aliases are the same
-# as the extras they are replaced with
-for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
- requirements = EXTRAS_REQUIREMENTS.get(extra) if extra != '' else []
- if requirements is None:
- raise Exception(f"The extra {extra} is missing for deprecated alias
{alias}")
- # Note the requirements are not copies - those are the same lists as for
the new extras. This is intended.
- # Thanks to that if the original extras are later extended with providers,
aliases are extended as well.
- EXTRAS_REQUIREMENTS[alias] = requirements
+def add_extras_for_all_deprecated_aliases() -> None:
+ """
+ Add extras for all deprecated aliases. Requirements for those deprecated
aliases are the same
+ as the extras they are replaced with.
+ The requirements are not copies - those are the same lists as for the new
extras. This is intended.
+ Thanks to that if the original extras are later extended with providers,
aliases are extended as well.
+ """
+ for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
+ requirements = EXTRAS_REQUIREMENTS.get(extra) if extra != '' else []
+ if requirements is None:
+ raise Exception(f"The extra {extra} is missing for deprecated
alias {alias}")
+ EXTRAS_REQUIREMENTS[alias] = requirements
+
+
+add_extras_for_all_deprecated_aliases()
Review comment:
Just thinking there are some cases where we `import setup` and might not
want these called.
But if that isn't the case and everywhere we import it we'd want these
called then we can leave this as it is.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]