Name | pyproject-scripts JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Run scripts defined in a project's pyproject.toml (like npm run) |
upload_time | 2025-08-30 19:22:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
pyproject
scripts
cli
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
# pyproject-scripts (`pps`)
Tiny, dependency‑free project‑local script runner for Python projects: declare scripts in `pyproject.toml` under `[tool.scripts.*]`, get instant `pps <name>` subcommands.
</div>
---
## Installation
```bash
# Install from PyPI
pip install pyproject-scripts
# editable / dev inside a cloned repo
pip install -e .
# or with uv
uv pip install -e .
```
---
## Defining Scripts
Define scripts in `pyproject.toml` under the `[tool.scripts]` table according to this schema:
```toml
[tool.scripts.<your-script-name>]
cmd = "<your command here>"
description = "<short description>"
cwd = "<optional working directory>"
env = { "<VAR>" = "<value>", ... }
shell = true | false
```
The meaning of each field is as follows:
| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `cmd` | Yes | string | Command to execute (interpreted by shell unless `shell=false`). |
| `description` | No | string | Short human description shown in help listing. |
| `cwd` | No | string | Working directory (relative to discovered project root) or absolute path. |
| `env` | No | table | Extra environment vars (stringified) layered over current env. |
| `shell` | No | bool | `true`/omitted: run via shell. `false`: tokenize with `shlex.split` and exec directly. |
---
## Usage Examples
Here's an example `pyproject.toml` snippet defining two scripts, `lint` and `test`:
```toml
[tool.scripts.lint]
cmd = "ruff check . && ruff format --check ."
description = "Run ruff linter"
cwd = "src"
env = { "RUST_LOG" = "info" }
shell = true
[tool.scripts.test]
cmd = "pytest -q"
description = "Run test suite"
shell = false
```
To run the `lint` script, simply execute:
```bash
pps lint
```
Additional arguments can be passed, for example to run a specific test file. Every
argument after the script name is forwarded to the command:
```bash
pps test tests/test_special_case.py
```
---
## Supported Python Versions
Tested on CPython >= 3.11. Older versions are not targeted because `tomllib`, used for parsing `pyproject.toml`, is only in the standard library since 3.11.
---
## License
AGPL-3.0-or-later. See `LICENSE` for full text.
Raw data
{
"_id": null,
"home_page": null,
"name": "pyproject-scripts",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "pyproject, scripts, cli",
"author": null,
"author_email": "Oliver Kleinke <oliver.kleinke@c-01a.de>",
"download_url": "https://files.pythonhosted.org/packages/78/65/543d57a148a7f72e97592eb40d26006e546346362d4b017a969552d7060c/pyproject_scripts-0.1.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n# pyproject-scripts (`pps`)\n\nTiny, dependency\u2011free project\u2011local script runner for Python projects: declare scripts in `pyproject.toml` under `[tool.scripts.*]`, get instant `pps <name>` subcommands.\n\n</div>\n\n---\n## Installation\n\n```bash\n# Install from PyPI\npip install pyproject-scripts\n\n# editable / dev inside a cloned repo\npip install -e .\n# or with uv\nuv pip install -e .\n```\n\n---\n## Defining Scripts\n\nDefine scripts in `pyproject.toml` under the `[tool.scripts]` table according to this schema:\n\n```toml\n[tool.scripts.<your-script-name>]\ncmd = \"<your command here>\"\ndescription = \"<short description>\"\ncwd = \"<optional working directory>\"\nenv = { \"<VAR>\" = \"<value>\", ... }\nshell = true | false\n```\n\nThe meaning of each field is as follows:\n\n| Field | Required | Type | Description |\n|-------|----------|------|-------------|\n| `cmd` | Yes | string | Command to execute (interpreted by shell unless `shell=false`). |\n| `description` | No | string | Short human description shown in help listing. |\n| `cwd` | No | string | Working directory (relative to discovered project root) or absolute path. |\n| `env` | No | table | Extra environment vars (stringified) layered over current env. |\n| `shell` | No | bool | `true`/omitted: run via shell. `false`: tokenize with `shlex.split` and exec directly. |\n\n---\n## Usage Examples\n\nHere's an example `pyproject.toml` snippet defining two scripts, `lint` and `test`:\n\n```toml\n[tool.scripts.lint]\ncmd = \"ruff check . && ruff format --check .\"\ndescription = \"Run ruff linter\"\ncwd = \"src\"\nenv = { \"RUST_LOG\" = \"info\" }\nshell = true\n\n[tool.scripts.test]\ncmd = \"pytest -q\"\ndescription = \"Run test suite\"\nshell = false\n```\n\nTo run the `lint` script, simply execute:\n\n```bash\npps lint\n```\n\nAdditional arguments can be passed, for example to run a specific test file. Every\nargument after the script name is forwarded to the command:\n\n```bash\npps test tests/test_special_case.py\n```\n\n---\n## Supported Python Versions\n\nTested on CPython >= 3.11. Older versions are not targeted because `tomllib`, used for parsing `pyproject.toml`, is only in the standard library since 3.11.\n\n---\n## License\n\nAGPL-3.0-or-later. See `LICENSE` for full text.\n",
"bugtrack_url": null,
"license": null,
"summary": "Run scripts defined in a project's pyproject.toml (like npm run)",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/okleinke/pyproject-scripts"
},
"split_keywords": [
"pyproject",
" scripts",
" cli"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8095816919f18270ffc7f3986643f5fb94977ae33290b2e2f6872360db0ad6bb",
"md5": "d8df0f8ceae2a1890a92ec774dd2b21d",
"sha256": "77cb2967e8ada1f6a0c023074dfa08a2f6f106f3ac43d6d2509a56eb8272b644"
},
"downloads": -1,
"filename": "pyproject_scripts-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d8df0f8ceae2a1890a92ec774dd2b21d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 16207,
"upload_time": "2025-08-30T19:21:59",
"upload_time_iso_8601": "2025-08-30T19:21:59.696662Z",
"url": "https://files.pythonhosted.org/packages/80/95/816919f18270ffc7f3986643f5fb94977ae33290b2e2f6872360db0ad6bb/pyproject_scripts-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7865543d57a148a7f72e97592eb40d26006e546346362d4b017a969552d7060c",
"md5": "8cd6b5566885020ecb0279688351cdce",
"sha256": "3ad3714dc9100bb91d1a0a141a36c6624dd9a8cfa66595908aac90e7f65caff9"
},
"downloads": -1,
"filename": "pyproject_scripts-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "8cd6b5566885020ecb0279688351cdce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 16947,
"upload_time": "2025-08-30T19:22:00",
"upload_time_iso_8601": "2025-08-30T19:22:00.771255Z",
"url": "https://files.pythonhosted.org/packages/78/65/543d57a148a7f72e97592eb40d26006e546346362d4b017a969552d7060c/pyproject_scripts-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-30 19:22:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "okleinke",
"github_project": "pyproject-scripts",
"github_not_found": true,
"lcname": "pyproject-scripts"
}