[run] feat: Add Rye support to Python detector#23
Conversation
Adds detection logic, command validation, and command building for the Rye Python package manager. Rye projects are identified by checking for `[tool.rye]` in `pyproject.toml`, and scripts are validated against the `[tool.rye.scripts]` table. Co-authored-by: insign <1113045+insign@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57b808759c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if has_pyproject { | ||
| if let Ok(content) = fs::read_to_string(&pyproject_path) { | ||
| if let Ok(toml_value) = toml::from_str::<toml::Value>(&content) { | ||
| is_rye = toml_value.get("tool").and_then(|t| t.get("rye")).is_some(); |
There was a problem hiding this comment.
Narrow Rye detection to avoid uv migration conflicts
Detecting Rye whenever any [tool.rye] table exists causes mixed uv/Rye projects (common during migration) to be classified as both rye and uv, because uv.lock is still detected below. In that case check_conflicts treats Python tools as a lockfile conflict and can error when both binaries are installed, which is a regression from previously selecting uv-only projects. Please gate Rye detection on a stronger Rye-specific signal (for example Rye lockfiles or explicit managed flag semantics) so uv projects with leftover metadata do not hard-fail.
Useful? React with 👍 / 👎.
| // Check [tool.rye.scripts] (Rye) | ||
| if let Some(scripts) = toml_value | ||
| .get("tool") | ||
| .and_then(|t| t.get("rye")) | ||
| .and_then(|p| p.get("scripts")) | ||
| .and_then(|s| s.as_table()) | ||
| { | ||
| if scripts.contains_key(command) { | ||
| return CommandSupport::Supported; |
There was a problem hiding this comment.
Restrict Rye script validation to the Rye runner
This validator is shared by all Python runners (uv, poetry, pipenv, pip, and rye), so adding [tool.rye.scripts] as universally Supported makes non-Rye runners claim support for Rye-only task definitions. select_runner prefers supported runners by priority, so a higher-priority non-Rye runner can be selected and then execute a command form it does not actually implement (e.g., uv run <rye-script>), producing runtime failures.
Useful? React with 👍 / 👎.
This pull request adds support for the Rye package manager within the Python ecosystem, making the
runCLI compatible with projects using Rye. This is highly useful as Rye is becoming an increasingly popular, modern all-in-one Python tool.The PR updates
src/detectors/python.rsto detect Rye projects by looking for[tool.rye]inpyproject.toml, and to validate custom commands by checking[tool.rye.scripts].src/detectors/mod.rswas updated to construct the correct command runner (rye run <task>). Comprehensive unit tests are included. This improves developer experience for developers adopting Rye.PR created automatically by Jules for task 17353587990444091902 started by @insign