potiuk commented on a change in pull request #12383: URL: https://github.com/apache/airflow/pull/12383#discussion_r524963780
########## 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: Review comment: I think that might work but it will complicate the whole selection of when we install providers from sources and when as packages (the setup.py selection criteria will have to be much more complex, because you will always want to install airflow/providers/manager.py but not instal anything else there. Also In this case we will not be able to detect the case "no providers installed" easily. Right now I log a warning if "airflow.providers" cannot be imported. Also it will complicate #11435. One of the checks we want to do is to make sure none of the code in core is importing my of the "airflow.providers" stuff. I plan to use that class in webserver, CLI and API which would mean that we will have to manually filter out those imports if we move it to "airflow.providers" I think "providers" package should be purely for provider implementation (see below as well), not for provider's management - similarly as we do 'plugin_manger,py". You even commented that in my POC that it should be moved to where 'pliugin" management is. I think it's a good place where it is.now. ---------------------------------------------------------------- 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]
