Skip to content

[run] feat: Add Rye support to Python detector#23

Merged
insign merged 1 commit into
mainfrom
feat-python-rye-support-17353587990444091902
May 13, 2026
Merged

[run] feat: Add Rye support to Python detector#23
insign merged 1 commit into
mainfrom
feat-python-rye-support-17353587990444091902

Conversation

@insign
Copy link
Copy Markdown
Contributor

@insign insign commented May 12, 2026

This pull request adds support for the Rye package manager within the Python ecosystem, making the run CLI 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.rs to detect Rye projects by looking for [tool.rye] in pyproject.toml, and to validate custom commands by checking [tool.rye.scripts]. src/detectors/mod.rs was 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

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/detectors/python.rs
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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/detectors/python.rs
Comment on lines +59 to +67
// 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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@insign insign merged commit bebde25 into main May 13, 2026
6 of 8 checks passed
@insign insign deleted the feat-python-rye-support-17353587990444091902 branch May 13, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant