Skip to main content

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

See a real example

[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

poethepoet-0.2.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

poethepoet-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file poethepoet-0.2.0.tar.gz.

File metadata

  • Download URL: poethepoet-0.2.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.7.7 Linux/5.3.0-1022-azure

File hashes

Hashes for poethepoet-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4af43d1f9291891d12c6b6f8ebaf23abe34ef7ea2dcad00c1076a561ae18bb0c
MD5 70066eeaadf4c7c7d5481e835de5af4e
BLAKE2b-256 e5a45ed39c05398a239e4da1249504f6760e27ce07c7ddf9e55b38097c60a3c6

See more details on using hashes here.

File details

Details for the file poethepoet-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: poethepoet-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.7.7 Linux/5.3.0-1022-azure

File hashes

Hashes for poethepoet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bb129b83c53a9aaa2a9e0813f0e49b5f5e3f61a88b5f4c79eb9d107fd4e895e
MD5 70a4a1716db42bc3fe47490cf8a7668d
BLAKE2b-256 50046a69f7cdd6b5ac9ccb27a0e8b62319a54615ab3899a19e9526b34784249f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page