A task runner that works well with poetry.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for poethepoet-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb129b83c53a9aaa2a9e0813f0e49b5f5e3f61a88b5f4c79eb9d107fd4e895e |
|
MD5 | 70a4a1716db42bc3fe47490cf8a7668d |
|
BLAKE2b-256 | 50046a69f7cdd6b5ac9ccb27a0e8b62319a54615ab3899a19e9526b34784249f |