potiuk commented on a change in pull request #13439:
URL: https://github.com/apache/airflow/pull/13439#discussion_r551388151
##########
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:
The only reason I made it here is to be able to remove the whole section
for "deprecated aliases. But I think I can move them to main indeed. In
pre-commit where I check whether setup.py and documentation are synchronized, I
already call the one function which I call in main. There might be some
dependencies between the sequence of calls and definitions of dicts/arrays, but
I think I can solve all of them. Let me see.
----------------------------------------------------------------
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]