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

pip install poethepoet

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

pytest --cov=poethepoet -v tests/favorite_test.py

You can also run it like so if you fancy

python -m poethepoet

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 doesn’t set the current workind directory to run tasks, however the parent directory of the toml file can be accessed as $POE_ROOT within the command line and process.

Poe can also be configured to set the working directory to the project root for all commands by setting tool.poe.run_in_project_root = true withing the pyproject.toml.

Contributing

Sure, why not?

TODO

  • make the cli more friendly with colors and supportive helpful messages

  • support running tasks outside of poetry’s virtualenv (or in another?)

  • support declaring specific arguments for a task

  • test better

  • task composition/aliases

  • validate tool.poe config in toml

  • maybe try work well without poetry too

Licence

MIT. Go nuts.

Project details


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.0.3.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

poethepoet-0.0.3-py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 3

Supported by

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