Skip to content

Commit

Permalink
Refactor unneeded 'continue' jumps in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eumiro committed Aug 29, 2023
1 parent 6c943ca commit b8b6475
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,8 @@ def add_extras_for_all_deprecated_aliases() -> None:
"""
for alias, extra in EXTRAS_DEPRECATED_ALIASES.items():
dependencies = EXTRAS_DEPENDENCIES.get(extra) if extra != "" else []
if dependencies is None:
continue
EXTRAS_DEPENDENCIES[alias] = dependencies
if dependencies is not None:
EXTRAS_DEPENDENCIES[alias] = dependencies


def add_all_deprecated_provider_packages() -> None:
Expand All @@ -623,9 +622,8 @@ def add_all_deprecated_provider_packages() -> None:
{"kubernetes": ["apache-airflow-provider-cncf-kubernetes"]}
"""
for alias, provider in EXTRAS_DEPRECATED_ALIASES.items():
if alias in EXTRAS_DEPRECATED_ALIASES_NOT_PROVIDERS:
continue
replace_extra_dependencies_with_provider_packages(alias, [provider])
if alias not in EXTRAS_DEPRECATED_ALIASES_NOT_PROVIDERS:
replace_extra_dependencies_with_provider_packages(alias, [provider])


add_extras_for_all_deprecated_aliases()
Expand Down Expand Up @@ -665,10 +663,9 @@ def add_all_deprecated_provider_packages() -> None:
def get_all_db_dependencies() -> list[str]:
_all_db_reqs: set[str] = set()
for provider in ALL_DB_PROVIDERS:
if provider not in PROVIDER_DEPENDENCIES:
continue
for req in PROVIDER_DEPENDENCIES[provider][DEPS]:
_all_db_reqs.add(req)
if provider in PROVIDER_DEPENDENCIES:
for req in PROVIDER_DEPENDENCIES[provider][DEPS]:
_all_db_reqs.add(req)
return list(_all_db_reqs)


Expand Down

0 comments on commit b8b6475

Please sign in to comment.