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 2019/01/08 14:28:07 UTC

[GitHub] ashb commented on a change in pull request #4412: [AIRFLOW-3605] Load plugins from entry_points

ashb commented on a change in pull request #4412: [AIRFLOW-3605] Load plugins from entry_points
URL: https://github.com/apache/airflow/pull/4412#discussion_r246014440
 
 

 ##########
 File path: docs/plugins.rst
 ##########
 @@ -220,3 +220,26 @@ Note on role based views
 Airflow 1.10 introduced role based views using FlaskAppBuilder. You can configure which UI is used by setting
 rbac = True. To support plugin views and links for both versions of the UI and maintain backwards compatibility,
 the fields appbuilder_views and appbuilder_menu_items were added to the AirflowTestPlugin class.
+
+
+Plugins as Python packages
+--------------------------
+
+It is possible to load plugins via `setuptools' entrypoint<https://packaging.python.org/guides/creating-and-discovering-plugins/#using-package-metadata>`_ mechanism. To do this link
+your plugin using an entrypoint in your package. If the package is installed, airflow
+will automatically load the registered plugins from the entrypoint list.
+
+.. code-block:: python
+
+    from setuptools import setup
+
+    setup(
+        name="my-package",
+        ...
+        entry_points = {
+            'airflow.plugins': [
+                'my_plugin = my_package.my_plugin:MyAirflowPlugin'
+            ]
+        }
+    )
+
 
 Review comment:
   Could you extend this doc to make it clear under what name this plugin will be available? Because I don't think that _any_ of these names actually appears in the airflow plugin import statement at use time? (Though that might be clearer if it did?)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services