You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/27 10:02:06 UTC

[GitHub] [airflow] j-y-matsubara commented on a change in pull request #9531: Support .airflowignore for plugins : .pluginingore

j-y-matsubara commented on a change in pull request #9531:
URL: https://github.com/apache/airflow/pull/9531#discussion_r446508436



##########
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:
       You are right.
   In fact, this is pretty much the same code.
   
    I make a generator. What do you think of this? 
   (Perhaps we can make the generator func share with file.py but....)




----------------------------------------------------------------
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:
users@infra.apache.org