This file contains some snippets on things you might find yourself doing in this repo.
There are lots of good Poetry tutorials on the webs; here's one I like.
Run
poetry shell
Python has a third party Poetry plugin in their marketplace which was, as of this writing (2021-03-19
), unstable for me. My workaround was to make a poetry shell
and use path it made is a virtualenv
in Pycharm.
typer is a type-hint driven CLI builder. It's really nice.
poetry add typer
Using version ^0.3.2 for typer
Updating dependencies
Resolving dependencies... (0.4s)
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing typer (0.3.2)
Some variations on add:
poetry add typer@latest # get the latest version of an already installed dependency
poetry add "typer>=0.3.1" # get at least version 0.3.1
poetry add ../my-package/dist/my-package-0.1.0.tar.gz # add a local package
Or not!
poetry remove typer
Updating dependencies
Resolving dependencies... (0.2s)
Writing lock file
Package operations: 0 installs, 0 updates, 1 removal
• Removing typer (0.3.2)
poetry build
Building effectivepy (0.1.0)
- Building sdist
- Built effectivepy-0.1.0.tar.gz
- Building wheel
- Built effectivepy-0.1.0-py3-none-any.whl
Remove the I
in pyproject.toml. For full cleanse, `poetry remove --dev pylint-import-order
Run make black
or poetry run black
Set it in the [tool.black]
section of the pyproject.toml file.
Run poetry run pytest ARGS
; for example:
poetry run pytest --cov tests