Skip to main content

A Simple task runner for pyproject.toml, written in Rust.

Project description

Libretto

A Simple task runner for pyproject.toml, written in Rust.

Install

uv tool install libretto

Configuration

Libretto can be configured in the [tool.libretto] section of your pyproject.toml file.

venv

Specifies the path to the virtual environment to use when running tasks.

[tool.libretto]
venv = ".venv"

Example

[tool.libretto]
venv = ".venv"

[tool.libretto.tasks]
hello = "echo 'Hello, World!'"

Usage

Libretto reads tasks from the pyproject.toml file in the current directory. Tasks are defined in the [tool.libretto.tasks] section.

To run a task, use the libretto command followed by the task name:

libretto <task_name>

For example, to run the hello task from the example above:

libretto hello

This will output:

Hello, World!

Passing Additional Arguments

You can pass additional arguments to your tasks. For example, if you have a task defined as:

[tool.libretto.tasks]
greet = "echo Hello"

You can run it with an additional argument:

libretto greet John

This will output:

Hello John

Command Lists

You can also define a list of commands for a single task. Libretto will execute them in order.

[tool.libretto.tasks]
build = [
    "echo Building...",
    "py -m build"
]

Running libretto build will execute both commands.

Platform-Specific Commands

You can define platform-specific commands by using a list of tables. list of available platforms is here.

[tool.libretto.tasks]
test = [
    { cmd = "rm --rf dist", platforms = ["linux", "macos"] },
    { cmd = "rmdir /s /q dist", platforms = ["windows"] }
]

Libretto will only execute the command that matches the current platform.

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

libretto-0.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libretto-0.2.0-py3-none-manylinux_2_39_x86_64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

File details

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

File metadata

  • Download URL: libretto-0.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.6

File hashes

Hashes for libretto-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec0489aa74e6c56fac05882a6338b6852a715db5f92e80e077bfc141b9ff8da0
MD5 74adcb37304464708beae57cf491d04e
BLAKE2b-256 17a8c370bf3a1900b1b1fcd03dcbe613cee7298c9a81ec33644b516a5c51583b

See more details on using hashes here.

File details

Details for the file libretto-0.2.0-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for libretto-0.2.0-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 c9f74ac4a231900bf21337abc949f9b3ab2d3953895af9a8d7e0513c1cba4b14
MD5 68a7ef6f67c2e894677d38037cee4464
BLAKE2b-256 fe4a9bea77ae174c1a47a9b9875b2ea0934d375e40f3340e9a3195469e7f23e8

See more details on using hashes here.

Supported by

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