Skip to content

Commit

Permalink
Python: Add Poetry IDEA instructions (apache#4980)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko authored Jun 9, 2022
1 parent 2244ade commit 8499856
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions python/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ To get started, you can run `make install`, which will install poetry and it wil

If you want to install the library on the host, you can simply run `pip3 install -e .`. If you wish to use a virtual environment, you can run `poetry shell`. Poetry will open up a virtual environment with all the dependencies set.

To set up IDEA with Poetry ([also on Loom](https://www.loom.com/share/6d36464d45f244729d91003e7f671fd2)):

- Open up the Python project in IntelliJ
- Make sure that you're on a lastest master (that includes Poetry)
- Go to File -> Project Structure (⌘;)
- Go to Platform Settings -> SDKs
- Click the + sign -> Add Python SDK
- Select Poetry Environment from the left hand side bar and hit OK
- It can take some time to download all the dependencies based on your internet
- Go to Project Settings -> Project
- Select the Poetry SDK from the SDK dropdown, and click OK

For IDEA ≤2021 you need to install the [Poetry integration as a plugin](https://plugins.jetbrains.com/plugin/14307-poetry/).

Now you're set using Poetry, and all the tests will run in Poetry, and you'll have syntax highlighting in the pyproject.toml to indicate stale dependencies.

## Linting

We rely on `pre-commit` to apply autoformatting and linting:
Expand Down

0 comments on commit 8499856

Please sign in to comment.