Skip to content

Latest commit

 

History

History
44 lines (24 loc) · 2.08 KB

POETRY.md

File metadata and controls

44 lines (24 loc) · 2.08 KB

Python Poetry

Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Documentation can be found here

Poetry uses the pyproject.toml file to declare dependencies instead of requirements.txt

Why Poetry

The main reason this project chose Poetry as the Python package manager was because of its use of toml as the format for the lock file. Toml is easy to parse which makes it east to generate a Lambda layer for all the dependencies.

Many others in the Python community are finding Poetry to be a better solution over straight pip, pipenv, conda, etc;

Using poetry with Intellij

To use Poetry's virtual environment in Intellij first follow the prerequisites in the README.md file

Then open the "Project Structure" in Intellij and select "SDKs" then click the "+" button to "Add New SDK"

poetry01.png

Select "Add Python SDK..."

poetry02.png

Select "Virtualenv Environment", select "Existing environment", and then click "..." next to "Interpreter"

poetry03.png Enter the path to your project's .venv/bin/python file and hit "OK"

poetry04.png

The classpath will be populated. Give the SDK a unique name to identify it as the SDK for this project.

poetry05.png

Finally, ensure your project has the newly created SDK selected under "Project Structure" -> "Project Settings" -> "Project" -> "Project SDK"

poetry06.png