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.txtpoetry shell==source .venv/bin/activateexit==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.lockcaches 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 updateupdates everything to the latest versions, overwritingpoetry.lockpoetry initinitializes a project and creates apyproject.tomlinteractively, allowing even to search for packages etc!
Adding packages:
poetry add yamladds a packagepoetry search yamllooks for packages in remote repos! Will tell you that you actually wantpyyaml
Nel mezzo del deserto posso dire tutto quello che voglio.