Poetry package manager
- Website
- Why Is Poetry Essential to the Modern Python Stack?
- Support for PEP 621 (PEP 621 – Storing project metadata in pyproject.toml)
Installation
python3-poetry
deb package is only available in ubuntu jammy and upwards.
Until then:
brew install poetry
or
pip install poetry
Usage
Setup
Either create a new project (creates a new directory structure and files)
poetry new
or
initialise an existing project
(Creates a pyproject.toml
file)
poetry init -n
Install packages
Add package:
poetry add pendulum
Install deps including the current project
poetry install
or only install dependencies from lock file
poetry install --no-root
Virtual envs
Show venv details:
poetry env info
Only show venv path:
poetry env info --path
Enable venv:
poetry env use python
poetry config virtualenvs.create false
Update poetry.lock
:
poetry update