Surface pyproject.toml [project.scripts] as runnable tasks#39
Conversation
Python projects detected a package manager (uv/poetry/pipenv) but never listed their PEP 621 [project.scripts] console entry points, so `runner` showed "no tasks" for a project full of declared scripts. Add a PyprojectScripts task source: parse [project.scripts] from pyproject.toml, surface each entry with its entry-point target as the description, and dispatch via the detected Python PM's run subcommand (uv run / poetry run / pipenv run). Honors an explicit Python-ecosystem --pm / [pm].python override, falling back to the detected PM.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
runner | bddba7f | Commit Preview URL Branch Preview URL |
Jun 04 2026, 09:33 AM |
|
Warning Review limit reached
More reviews will be available in 47 minutes and 24 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (14)
📝 WalkthroughWalkthroughThis PR implements end-to-end support for Python PEP 621 console scripts in Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
Align the PyprojectScripts source-path resolution in `runner list` (OSC8 links) and `runner why` (source_dir) with the upward-walking variant already used in run/select.rs, so all three path-resolution sites agree. find_first_upwards checks the root first, so behavior is unchanged for the currently reachable case (Python detection only reads pyproject.toml at the project root), but it future-proofs against ancestor pyproject.toml discovery. Addresses CodeRabbit review on PR #39. https://claude.ai/code/session_01C33r8rotqFuMbbNVvYYkPK
Match select.rs: PyprojectScripts source_dir walks ancestors via find_first_upwards instead of probing only the root, so list/why report the same dir where run executes the task.
14288bd to
5769518
Compare
Find pyproject.toml and Python PM signals upward so nested dirs list PEP 621 scripts. Show Python PM resolution in `why` and include pyproject.toml in `--source` help.
Problem
For Python projects,
runnerdetected the package manager (uv / poetry / pipenv) but never listed the PEP 621[project.scripts]console entry points declared inpyproject.toml. A project full of declared scripts showed no tasks:[project.scripts]was the one common task source with no extractor — every other source (package.json,Makefile,justfile,Taskfile,bacon.toml,mise.toml, Cargo aliases, Go packages) already had one.Change
Adds a
PyprojectScriptstask source end-to-end:tool/python.rs): parses[project.scripts]frompyproject.tomlvia thetomlcrate, surfacing each script name with its entry-point target (e.g.greenpy.main:main) as the description. Empty when absent/scriptless; a malformed manifest surfaces as aTaskListUnreadablewarning rather than silently dropping tasks.detect.rs): runs the extractor whenever a Python-ecosystem PM is detected, in the same scoped-parallel pool as the other extractors.cmd/run/dispatch.rs): runs via the detected Python PM'srunsubcommand —uv run <name>,poetry run <name>, orpipenv run <name>(run_cmdadded to each tool module). Honors an explicit Python-ecosystem--pm/[pm].pythonoverride, falling back to the detected PM.pyproject.tomlinrunner list, pluswhy, source selection, and JSON schema v1/v2 labels.Scoped to
[project.scripts](PEP 621) as reported — not the legacy poetry-specific[tool.poetry.scripts]table.Verification
Against the reported
pyproject.toml:Qualified syntax (
pyproject.toml:greenpy),runner why, and both JSON schema versions all work. New unit + detection tests added covering extraction (sorted names, missing/empty/malformed manifests), uv/poetry/pipenvrun_cmd, and dispatch.Full suite passes (560 unit + 21 integration + doctests); clippy and
fmt --checkclean.