potiuk commented on a change in pull request #12383: URL: https://github.com/apache/airflow/pull/12383#discussion_r524970486
########## File path: airflow/providers_manager.py ########## @@ -0,0 +1,78 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Manages all providers.""" +import importlib +import logging +import pkgutil +import traceback + +import yaml + +try: + import importlib.resources as pkg_resources +except ImportError: + # Try backported to PY<37 `importlib_resources`. + import importlib_resources as pkg_resources + + +log = logging.getLogger(__name__) + + +class ProvidersManager: + """Manages all provider packages.""" + + def __find_all_providers(self, paths: str): + def onerror(_): + exception_string = traceback.format_exc() + log.warning(exception_string) + + for module_info in pkgutil.walk_packages(paths, prefix="airflow.providers.", onerror=onerror): Review comment: Yeah. This is non-goal for 2.0 and we can certainly and easily change it in the future. However, I'd say we **CAN** put such constraint on the providers that they are all in "airflow.providers" package. There is nothing to prevent anyone from issuing their own packages providing - say - "airflow.providers.great-expectations" package. I think there are no limits/ownership problems in PyPI, nor ASF rules preventing from doing it (but I might be wrong here). Even if we would not like to share "airflow.providers" with 3rd-parties, we can propose another package if we want to separate it out as a convention. I believe everything for airflow (including 3rd-party packages) should begin with 'airflow". For example "airflow-3rd-party.providers" or "airflow-contrib.providers" could do the job and adding several different packages to provider manager should not be a problem. ---------------------------------------------------------------- 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]
