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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libretto-0.1.1.tar.gz.
File metadata
- Download URL: libretto-0.1.1.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
641d9c63752a06195af48933cdbd19a51d3371079956088d9882f849ad839261
|
|
| MD5 |
1f3e74f306aa8a4ccbee0bd7b895c840
|
|
| BLAKE2b-256 |
5c8f9583134a016007eb6da851cf20052df6d0b314ef26b62270005c736088c7
|
File details
Details for the file libretto-0.1.1-py3-none-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: libretto-0.1.1-py3-none-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e805a630af332145952834571cc08167eaf2480ab8fbbf55827ca17a5c27c236
|
|
| MD5 |
49e63d44106831b07afa6303f0abbe9e
|
|
| BLAKE2b-256 |
79b21ffa2152d81f8f488ed09df1f87e5b88fdc0fdcf7226c0eed3537ae2e7d9
|