Poetry cheat-sheet

The Poetry project setup python virtual environment that jail dependencies of each project so it does not impact your host system.

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Add a new lib for development purpose

poetry add <library> -G dev

Remove a lib

poetry remove <library>

Update a lib

poetry update <library>

Add a new development lib

poetry add -G dev <library>

Get venv path

poetry run which python

Run app

poetry run python app.py

Run tests

poetry run python -m unittest discover

Show dependencies

poetry show

Disable virtual environment creation

poetry config virtualenvs.create false

List configuratiom

poetry config --list

Configure your editor

  • Set lint to pylint
  • ...