mik-laj commented on a change in pull request #9531: URL: https://github.com/apache/airflow/pull/9531#discussion_r446210550
########## File path: airflow/plugins_manager.py ########## @@ -164,8 +163,28 @@ def load_plugins_from_plugin_directory(): global plugins # pylint: disable=global-statement log.debug("Loading plugins from directory: %s", settings.PLUGINS_FOLDER) + patterns_by_dir: Dict[str, List[Pattern[str]]] = {} + # Crawl through the plugins folder to find AirflowPlugin derivatives - for root, _, files in os.walk(settings.PLUGINS_FOLDER, followlinks=True): # noqa # pylint: disable=too-many-nested-blocks + for root, dirs, files in os.walk(settings.PLUGINS_FOLDER, followlinks=True): # noqa # pylint: disable=too-many-nested-blocks + + patterns: List[Pattern[str]] = patterns_by_dir.get(root, []) + ignore_file = os.path.join(root, '.pluginignore') + + if os.path.isfile(ignore_file): + with open(ignore_file, 'r') as file: Review comment: Hello. This code looks very similar to: https://github.com/apache/airflow/blob/master/airflow/utils/file.py#L125 I think you can make a generator that will take the starting path and yield for each file to load. Best regards, Kamil ---------------------------------------------------------------- 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: us...@infra.apache.org