Skip to content

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Jan 23, 2026

Summary by CodeRabbit

  • Improvements

    • Enhanced test-module dependency detection so test files are correctly included and mapped.
    • Improved module name resolution and deduplication for clearer dependency reports.
    • Dependency review comments now replace previous comments when updated for fresher data.
  • Style

    • Minor formatting tweaks to dependency and todo output for improved readability.

✏️ Tip: You can customize this high-level summary in your review settings.

@youknowone youknowone requested a review from moreal January 23, 2026 15:22
@youknowone youknowone marked this pull request as ready for review January 23, 2026 15:22
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds module-name resolution and redirection for dependency analysis: maps hard-dep names to parent modules, recognizes import test.x patterns, resolves/deduplicates module names in show_deps output, and tweaks workflow/test-file handling and todo-list formatting. (≤50 words)

Changes

Cohort / File(s) Summary
Workflow Config
​.github/workflows/lib-deps-check.yaml
Derive module names for files under Lib/test/* (include test_ modules rather than skipping); use recreate: true when posting dependency comments.
Dependency Parsing
scripts/update_lib/deps.py
Add `resolve_hard_dep_parent(name: str) -> str
Dependency Display / Resolution
scripts/update_lib/show_deps.py
Add _resolve_module_name() and integrate resolution: redirect test_ modules, map hard-deps to parents, resolve/dedupe input names while preserving order, and adjust whitespace/section formatting.
Todo Output Formatting
scripts/update_lib/show_todo.py
Prepend a literal "-" field to formatted todo lines (cosmetic formatting change).

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Workflow
    participant FS as Repository (Lib/, scripts/)
    participant Deps as deps.py
    participant Show as show_deps.py
    participant API as Comments API

    GH->>FS: Trigger lib-deps-check job
    FS->>Deps: Collect imports (including Lib/test/*)
    Deps->>Deps: parse_test_imports (handle "import test.x")
    Deps->>Deps: resolve_hard_dep_parent(name)
    Deps-->>Show: Emit resolved module list
    Show->>Show: _resolve_module_name -> dedupe & format
    Show->>API: Post/update dependency comment (recreate: true)
    API-->>GH: Comment updated
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

skip:ci

Suggested reviewers

  • moreal
  • ShaharNaveh

Poem

🐰
I nibble through imports, quick and spry,
Hard parents found beneath the sky,
Test modules hop into the list,
Dedupe dance — none will be missed,
Hooray, the deps are neat and spry!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'improve deps CI formatting and name resolution' accurately reflects the main changes across all modified files, which focus on enhancing CI workflow formatting and adding module name resolution logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Code has been automatically formatted

The code in this PR has been formatted using:

  • ruff format
    Please pull the latest changes before pushing again:
git pull origin deps-ci

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/update_lib/show_deps.py`:
- Around line 161-171: The import list in scripts/update_lib/show_deps.py
includes unused symbols—remove pathlib, parse_lib_imports, and safe_read_text
from the top-level imports since they are not used in format_deps (pathlib is
imported where needed in _resolve_module_name); update the import block that
currently brings in DEPENDENCIES, find_dependent_tests_tree, get_lib_paths,
get_test_paths, parse_lib_imports, resolve_hard_dep_parent to drop
parse_lib_imports and remove the separate safe_read_text and pathlib imports so
only actually used symbols remain.

@youknowone youknowone merged commit 180c68e into RustPython:main Jan 23, 2026
0 of 2 checks passed
@youknowone youknowone deleted the deps-ci branch January 23, 2026 15:32
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