[update_lib] deps grouping by youknowone · Pull Request #6864 · RustPython/RustPython
Caution
Review failed
The pull request is closed.
📝 Walkthrough
Walkthrough
This PR expands DEPENDENCIES with extensive per-module test mappings, changes is_up_to_date() to require actual CPython library paths to be present before reporting up-to-date, and adds test-tracking/grouping helpers to compute and format TODOs grouped by library.
Changes
| Cohort / File(s) | Summary |
|---|---|
Dependency Data & Path Validation scripts/update_lib/deps.py |
DEPENDENCIES expanded with many "test" entries for Rust-implemented and stdlib modules (~+264/-2). is_up_to_date() now tracks whether any CPython lib paths were found (found_any) and returns up-to-date only when paths were actually inspected and matched. |
Library Path Filtering scripts/update_lib/show_deps.py |
Added use of get_lib_paths() when formatting deps and skip processing soft dependencies that have no CPython library paths present. |
Test Tracking & Formatting scripts/update_lib/show_todo.py |
Added _build_test_to_lib_map(), is_test_tracked(), and _format_test_suffix(); compute_test_todo_list() gains lib_status usage; formatting functions now group tests by library, sort by per-lib test order, and render grouped output with tracking-aware suffixes. (~+124/-28) |
Sequence Diagram
sequenceDiagram
participant Script as update_lib script
participant DEPS as DEPENDENCIES
participant FS as FileSystem (cpython repo)
participant Formatter as TodoFormatter
Script->>DEPS: Load module entries (incl. "test" lists)
Script->>FS: get_lib_paths(module)
alt lib paths found
FS-->>Script: lib paths list
Script->>FS: check CPython test file exists for each test
alt test exists
FS-->>Script: test path found
Script->>Formatter: mark test as tracked, assign lib_name & order
else test missing
FS-->>Script: not found
Script->>Formatter: mark test as untracked
end
Script->>Formatter: group tests by lib, sort by test_order
Formatter-->>Script: formatted grouped TODO lines with suffixes
else no lib paths
FS-->>Script: no paths
Script->>Formatter: skip dependency (no tests collected)
end
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
- update_lib todo also shows test todo #6859 — Overlaps with adding test-aware TODO features and similar helpers in
show_todo.py. - [update_lib] todo subcommand #6823 — Related extensions to
scripts/update_libfor test-to-library mapping and dependency handling. - [update_lib] show deps #6821 — Prior changes to dependency resolution and
is_up_to_datebehavior inscripts/update_lib/deps.py.
Suggested reviewers
- moreal
- ShaharNaveh
Poem
🐰 Hop-hop, the tests now find their trail,
Mapped to libs, in order without fail,
DEPENDENCIES sprout lists, neat and clear,
Grouped and tracked — the TODOs appear! 🥕
🚥 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 '[update_lib] deps grouping' accurately reflects the main changes: expanding DEPENDENCIES with per-module test entries and reorganizing test grouping/ordering logic throughout the three modified scripts. |
| 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.
Comment @coderabbitai help to get the list of available commands and usage tips.