From 2e0f98ef5f9c703bdeaff9fd6633b5328320507e Mon Sep 17 00:00:00 2001 From: nanohanno <44575187+nanohanno@users.noreply.github.com> Date: Fri, 1 Jul 2022 14:00:32 +0200 Subject: [PATCH 1/2] Update PythonVirtualenvOperator Howto --- docs/apache-airflow/howto/operator/python.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/apache-airflow/howto/operator/python.rst b/docs/apache-airflow/howto/operator/python.rst index 210b528cf2396..63a363f33337e 100644 --- a/docs/apache-airflow/howto/operator/python.rst +++ b/docs/apache-airflow/howto/operator/python.rst @@ -60,8 +60,7 @@ is evaluated as a :ref:`Jinja template `. PythonVirtualenvOperator ======================== -Use the :class:`~airflow.operators.python.PythonVirtualenvOperator` to execute -Python callables inside a new Python virtual environment. +Use the :class:`~airflow.operators.python.PythonVirtualenvOperator` to execute Python callables inside a new Python virtual environment. The ``virtualenv`` package needs to be installed in the environment that runs Airflow (as optional dependency ``pip install airflow[virtualenv]``). .. exampleinclude:: /../../airflow/example_dags/example_python_operator.py :language: python From d391d935b1a97c1d220cd6273066f7899061d465 Mon Sep 17 00:00:00 2001 From: nanohanno <44575187+nanohanno@users.noreply.github.com> Date: Fri, 1 Jul 2022 20:33:32 +0200 Subject: [PATCH 2/2] Add constraints to virtualenv installation in howto Co-authored-by: Jarek Potiuk --- docs/apache-airflow/howto/operator/python.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/apache-airflow/howto/operator/python.rst b/docs/apache-airflow/howto/operator/python.rst index 63a363f33337e..ac9070208f717 100644 --- a/docs/apache-airflow/howto/operator/python.rst +++ b/docs/apache-airflow/howto/operator/python.rst @@ -60,7 +60,7 @@ is evaluated as a :ref:`Jinja template `. PythonVirtualenvOperator ======================== -Use the :class:`~airflow.operators.python.PythonVirtualenvOperator` to execute Python callables inside a new Python virtual environment. The ``virtualenv`` package needs to be installed in the environment that runs Airflow (as optional dependency ``pip install airflow[virtualenv]``). +Use the :class:`~airflow.operators.python.PythonVirtualenvOperator` to execute Python callables inside a new Python virtual environment. The ``virtualenv`` package needs to be installed in the environment that runs Airflow (as optional dependency ``pip install airflow[virtualenv] --constraint ...``). .. exampleinclude:: /../../airflow/example_dags/example_python_operator.py :language: python