A task runner that works well with poetry.
Features
Straight foward declaration of project tasks in your pyproject.toml (kind of like npm scripts)
Task are run in poetry’s virtualenv by default
Short and sweet commands with extra arguments passed to the task
poe [options] task [task_args]tasks can reference environmental variables as if they were evaluated by a shell
Installation
Into your project (so it works inside poetry shell):
poetry add --dev poethepoet
And into your default python environment (so it works outside of poetry shell)
pip install poethepoet
Basic Usage
Define tasks in your pyproject.toml
[tool.poe.tasks]
test = "pytest --cov=poethepoet"
Run tasks with the poe cli
poe test
Additional argument are passed to the task so
poe test -v tests/favorite_test.py
results in the following be run inside poetry’s virtualenv
pytest --cov=poethepoet -v tests/favorite_test.py
You can also run it like so if you fancy
python -m poethepoet [options] task [task_args]
Or install it as a dev dependency with poetry and run it like
poetry add --dev poethepoet
poetry run poe [options] task [task_args]
Though it that case you might like to do alias poe='poetry run poe'.
Advanced usage
Run poe from anywhere
By default poe will detect when you’re inside a project with a pyproject.toml in the root. However if you want to run it from elsewhere that is supported too by using the –root option to specify an alternate location for the toml file.
By default poe will set the working directory to run tasks. If you want tasks to inherit the working directory from the environment that you disable this by setting the following in your pyproject.toml.
[tool.poe]
run_in_project_root = false
In all cases the path to project root (where the pyproject.toml resides) is be available as $POE_ROOT within the command line and process.
Contributing
Don’t delay, create an issue today!
TODO
support “script” tasks defined as references to python functions
task composition/aliases
support declaring specific arguments for a task
support documenting tasks
support running tasks outside of poetry’s virtualenv (or in another?)
maybe try work well without poetry too
Licence
MIT. Go nuts.
Metadata
Release files for poethepoet 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| poethepoet-0.2.0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| poethepoet-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.5 kB
Release files / poethepoet-0.2.0.tar.gz
| Download URL | poethepoet-0.2.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4af43d1f9291891d12c6b6f8ebaf23abe34ef7ea2dcad00c1076a561ae18bb0c
|
|
BLAKE2b-256 checksum How to use checksums |
e5a45ed39c05398a239e4da1249504f6760e27ce07c7ddf9e55b38097c60a3c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.7.7 Linux/5.3.0-1022-azure
|
Release files / poethepoet-0.2.0-py3-none-any.whl
| Download URL | poethepoet-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bb129b83c53a9aaa2a9e0813f0e49b5f5e3f61a88b5f4c79eb9d107fd4e895e
|
|
BLAKE2b-256 checksum How to use checksums |
50046a69f7cdd6b5ac9ccb27a0e8b62319a54615ab3899a19e9526b34784249f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.9 CPython/3.7.7 Linux/5.3.0-1022-azure
|