poetry
poetry
the official docs and project description might be a better resource if you want to get started. this page is more like a quick cheat sheet
creating a project
create new project:
poetry new project-nameuse poetry in an existing project:
poetry initpackage management
install packages defined in pyproject.toml:
poetry installadd package:
poetry add feedparserdelete / remove package:
poetry remove pendulumupdate packages:
poetry updateuse poetry virtualenv
depending on your config, the virtual environment poetry creates is automatically activated, if not, do this:
poetry shellif the above doesn’t work for some reason, that’s how I got it working otherwise:
source `poetry env info --path`/bin/activaterun scripts
poetry run python your_script.pyif a package you’ve added comes with an executable CLI tool, you can run them like this:
poetry run black
poetry run pytest