211123-2348 poetry for package management
Short notes about #py/poetry for package management
poetry new packagename
creates a poetry project
From within the folder with the package:
poetry install
==pip3 install -r requierements.txt
poetry shell
==source .venv/bin/activate
exit
==deactivate
Basic usage | Documentation | Poetry - Python dependency management and packaging made easy:
- venvs live in
{cache-dir}/virtualenvs
, which on my box is/home/me/.cache/pypoetry/virtualenvs/ptest-eeSDLvcF-py3.6/bin/activate
poetry.lock
caches the resolved packages once we install things once.- Must mach
pyproject.toml
, a warning will be shown otherwise - It’s important to commit it to a VCS! It has the exact versions it resolves, beneficial for everyone to use them
- Must mach
poetry update
updates everything to the latest versions, overwritingpoetry.lock
poetry init
initializes a project and creates apyproject.toml
interactively, allowing even to search for packages etc!
Adding packages:
poetry add yaml
adds a packagepoetry search yaml
looks for packages in remote repos! Will tell you that you actually wantpyyaml
Nel mezzo del deserto posso dire tutto quello che voglio.