Skip to content

Commit

Permalink
Add simple instructions for installing providers in editable mode
Browse files Browse the repository at this point in the history
After apache#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 apache#43082

It's not yet full set of docs explaining how to use workspaces
and UV. This shoudl be handled via  apache#43200
  • Loading branch information
potiuk committed Oct 29, 2024
1 parent fba1770 commit c2b6092
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions contributing-docs/07_local_virtualenv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down

0 comments on commit c2b6092

Please sign in to comment.