Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,41 @@ Setup your project
alt="Cloning github fork to Visual Studio Code">
</div>

3. If you use official Python plugin you also have to add "tests" directly of each
provider you want to develop as "Extra Paths". This way respective provider tests code
can be addressed in imports as ``from unit.postgres.hooks.test_postgres import ...``
This is important in Airflow 3.0 we split providers to be separate distributions -
each with separate ``pyproject.toml`` file. This might improve and might be better
automated in the future, but for now you need to do it for each provider separately.

To do this, open ``File -> Preferences -> Settings``

.. raw:: html

<div align="center" style="padding-bottom:10px">
<img src="images/vscode_settings_menu.png"
alt="Open VS Code settings menu">
</div>

In ``Settings`` tab navigate to ``Workspace`` (this will set extra paths only for this project)
and go to ``Extensions -> Pylance`` section. At ``Python -> Analysis: Extra Paths`` add
the path to the tests directory of the provider you want to develop.

.. raw:: html

<div align="center" style="padding-bottom:10px">
<img src="images/vscode_add_extra_paths_item.png"
alt="Add providers test directory to Extra Paths in Pylance">
</div>

NB: if you use pyright as LSP with other editor you can set ``extraPaths`` the same
way in ``pyrightconfig.json``, see |pyright_conf_md|.

.. |pyright_conf_md| raw:: html

<a href="https://github.com/microsoft/pyright/blob/main/docs/configuration.md" target="_blank">pyright configuration docs</a>

4. Once step 3 is done it is recommended to restart VS Code.

Setting up debugging
####################
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.