From c2b6092589e86a1ac3cb4c70859324e05f25605d Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 29 Oct 2024 12:01:01 +0100 Subject: [PATCH 1/2] Add simple instructions for installing providers in editable mode After #42505, you need to get through extra hoops to develop providers in Airflow's monorepo. This is a simple (not yet uv-specific) documentation on how to install providers in editable mode when you want to develop providers, so that you can run unit test. Copied mostly from https://github.com/apache/airflow/pull/43082 It's not yet full set of docs explaining how to use workspaces and UV. This shoudl be handled via #43200 --- INSTALL | 4 ++++ contributing-docs/07_local_virtualenv.rst | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/INSTALL b/INSTALL index 6583d9de44206..7520cb88aff37 100644 --- a/INSTALL +++ b/INSTALL @@ -93,6 +93,10 @@ or you can install all packages needed to run tests for core, providers, and all You can see the list of all available extras below. +Additionally when you want to develop providers you need to install providers code in editable mode: + + pip install -e "./providers" + # Using Hatch to manage your Python, virtualenvs, and build packages Airflow uses [hatch](https://hatch.pypa.io/) as a build and development tool. It is one of the popular diff --git a/contributing-docs/07_local_virtualenv.rst b/contributing-docs/07_local_virtualenv.rst index a5238bfe829b9..3e7c154508c4b 100644 --- a/contributing-docs/07_local_virtualenv.rst +++ b/contributing-docs/07_local_virtualenv.rst @@ -125,6 +125,25 @@ The full list of extras is available in `pyproject.toml <../pyproject.toml>`_ an If you wish to install airflow using those tools you should use the constraint files and convert them to appropriate format and workflow that your tool requires. +Developing community providers in local virtualenv +.................................................. + +While the above installation is good enough to work on Airflow code, in order to develop +providers, you also need to install them in the virtualenv you work on (after installing +the extras in airflow, that correspond to the provider you want to develop). + +If you want to develop google providers, for example you can run the following commands: + +.. code:: bash + + pip install -e ".[devel,devel-tests,google]" + pip install -e "./providers" + +The first command installs airflow, it's development dependencies, test dependencies and +both runtime and development dependencies of the google provider. + +The second one installs providers source code in development mode, so that modifications +to the cod are automatically reflected in your installed virtualenv. Using Hatch ----------- From 00d021752932aa54d15b37678e95c20f543a82c7 Mon Sep 17 00:00:00 2001 From: Kaxil Naik Date: Tue, 29 Oct 2024 12:16:09 +0000 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Amogh Desai --- contributing-docs/07_local_virtualenv.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing-docs/07_local_virtualenv.rst b/contributing-docs/07_local_virtualenv.rst index 3e7c154508c4b..48dc8a2fe08a7 100644 --- a/contributing-docs/07_local_virtualenv.rst +++ b/contributing-docs/07_local_virtualenv.rst @@ -143,7 +143,7 @@ The first command installs airflow, it's development dependencies, test dependen both runtime and development dependencies of the google provider. The second one installs providers source code in development mode, so that modifications -to the cod are automatically reflected in your installed virtualenv. +to the code are automatically reflected in your installed virtualenv. Using Hatch -----------