This guide contains instructions on how to setup Python with Gradle within the Airbyte Monorepo. If you are a contributor working on one or two connectors, this page is most likely not relevant to you. Instead, you should use your standard Python development flow.
Before working with connectors written in Python, we recommend running
./gradlew :airbyte-integrations:connectors:<connector directory name>:build
from the root project directory. This will create a
virtualenv and install dependencies for the connector you want to work on as well as any internal Airbyte python packages it depends on.
When iterating on a single connector, you will often iterate by running
This command will:
Install a virtual environment at
Install local development dependencies specified in
To format and lint your code before commit you can use the Gradle command above, but for convenience we support pre-commit tool. To use it you need to install it first:
pip install pre-commit
then, to install
pre-commit as a git hook, run
pre-commit will format/lint the code every time you commit something. You find more information about pre-commit here.
At Airbyte, we use IntelliJ IDEA for development. Although it is possible to develop connectors with any IDE, we typically recommend IntelliJ IDEA or PyCharm, since we actively work towards compatibility.
Install the Pydantic plugin. This will help autocompletion with some of our internal types.
The following setup steps are written for PyCharm but should have similar equivalents for IntelliJ IDEA:
File -> New -> Project...
Select a project name like
airbyte and a directory outside of the
airbyte code root.
Prefferences -> Project -> Python Interpreter
Find a gear ⚙️ button next to
Python interpreter dropdown list, click and select
Virtual Environment -> Existing
Set the interpreter path to the one that was created by Gradle command, i.e.
Wait for PyCharm to finish indexing and loading skeletons from selected virtual environment.
You should now have access to code completion and proper syntax highlighting for python projects.
If you need to work on another connector you can quickly change the current virtual environment in the bottom toolbar.