Define custom scripts in your pyproject.toml and easily run them with this dependency free tool.
Project description
TOML Run
Define custom scripts in your pyproject.toml and easily run them with this dependency free tool. This tool is both inspired by and similar to NPM Scripts.
If you run into any issues or have any questions, support is available.
To get started Install the cli and view the Usage.
Features
- Define scripts in your
pyproject.toml - Easily run scripts with
run [name] - Cross-platform support using subprocess
- Supports
preandpostscripts - Supports multiple commands per script
- Pass additional arguments to scripts
- Automatically finds the
pyproject.toml - Runs scripts relative to the root directory
- Evaluate python code 🧪 (experimental)
Install
From PyPI: https://pypi.org/p/toml-run
pip install toml-run
pip install --group dev toml-run
uv tool install toml-run
uv add --dev toml-run
Usage
First, add some scripts to the pyproject.toml using the [tool.scripts] section.
[tool.scripts]
prepare = "python scripts/prepare.py"
build = "run prepare && uv run hatch build"
prelint = "echo always runs before lint"
lint = ["black --check .", "ruff check ."]
postlint = "echo always runs after lint"
format = """
black .
ruff format .
"""
clean = "#py shutil.rmtree('.cache', True)"
Run scripts with the run command.
run build
List available scripts with --list.
run -l
Run without installing using astral-sh/uv.
uvx toml-run build
Support
If you run into any issues or need help getting started, please do one of the following:
- Report an Issue: https://github.com/cssnr/toml-run/issues
- Q&A Discussion: https://github.com/cssnr/toml-run/discussions/categories/q-a
- Request a Feature: https://github.com/cssnr/toml-run/issues/new?template=1-feature.yaml
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
Contributing
If you would like to submit a PR, please review the CONTRIBUTING.md.
Please consider making a donation to support the development of this project and additional open source projects.
For a full list of current projects visit: https://cssnr.github.io/
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
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 toml_run-0.0.2.tar.gz.
File metadata
- Download URL: toml_run-0.0.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94ef95267c2aee45c12121993b0a85cdd614c60a54e90542753226ed41d8b86
|
|
| MD5 |
215269cc4062c886d6b5d6a7731f8d82
|
|
| BLAKE2b-256 |
049fcc38ec7c7b94fbba9c50d9e1b0b7f0c08700a58d054ef8ad996d20b66415
|
Provenance
The following attestation bundles were made for toml_run-0.0.2.tar.gz:
Publisher:
release.yaml on cssnr/toml-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toml_run-0.0.2.tar.gz -
Subject digest:
f94ef95267c2aee45c12121993b0a85cdd614c60a54e90542753226ed41d8b86 - Sigstore transparency entry: 774657550
- Sigstore integration time:
-
Permalink:
cssnr/toml-run@170e94ebd2dc4e3ed475f1aa21875233b2111bf3 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/cssnr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@170e94ebd2dc4e3ed475f1aa21875233b2111bf3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file toml_run-0.0.2-py3-none-any.whl.
File metadata
- Download URL: toml_run-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d473dfa384c2ce73e45a1152e20a4c75ce9f1dbff4de5ef5dd0a77d36c8032a
|
|
| MD5 |
56d85cb2603493e1fcd1e32f3c0c7009
|
|
| BLAKE2b-256 |
de9490edff2fdd55d29e5bec9633b6783017815ede6390278d260b219adbcffb
|
Provenance
The following attestation bundles were made for toml_run-0.0.2-py3-none-any.whl:
Publisher:
release.yaml on cssnr/toml-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toml_run-0.0.2-py3-none-any.whl -
Subject digest:
0d473dfa384c2ce73e45a1152e20a4c75ce9f1dbff4de5ef5dd0a77d36c8032a - Sigstore transparency entry: 774657559
- Sigstore integration time:
-
Permalink:
cssnr/toml-run@170e94ebd2dc4e3ed475f1aa21875233b2111bf3 -
Branch / Tag:
refs/tags/0.0.2 - Owner: https://github.com/cssnr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@170e94ebd2dc4e3ed475f1aa21875233b2111bf3 -
Trigger Event:
release
-
Statement type: