Skip to content

Revert "ast.NodeVisitor for import tracking (#7229)"#7230

Merged
youknowone merged 1 commit intoRustPython:mainfrom
youknowone:ast-revert
Feb 26, 2026
Merged

Revert "ast.NodeVisitor for import tracking (#7229)"#7230
youknowone merged 1 commit intoRustPython:mainfrom
youknowone:ast-revert

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Feb 26, 2026

The feature was good, but skip ci missed test regression.
@ShaharNaveh lets fix the test and merge this again

Summary by CodeRabbit

  • Refactor
    • Optimized internal dependency verification and todo tracking scripts for improved efficiency and maintainability.

@youknowone youknowone marked this pull request as ready for review February 26, 2026 18:54
@youknowone youknowone enabled auto-merge (squash) February 26, 2026 18:55
@youknowone youknowone disabled auto-merge February 26, 2026 18:55
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 804a7e4 and bb5fd9e.

📒 Files selected for processing (2)
  • scripts/update_lib/cmd_todo.py
  • scripts/update_lib/deps.py

📝 Walkthrough

Walkthrough

Narrowed test→library name extraction to only strip the "test_" prefix and refactored import parsing from an AST-based ImportVisitor to regex-based functions (_extract_top_level_code, parse_test_imports, parse_lib_imports) in the update_lib scripts.

Changes

Cohort / File(s) Summary
Test Library Name Mapping
scripts/update_lib/cmd_todo.py
Changed lib_name derivation to remove only the test_ prefix (no longer strips trailing _test).
Import Parsing Refactor
scripts/update_lib/deps.py
Removed AST ImportVisitor; added _extract_top_level_code, parse_test_imports, parse_lib_imports, and regex constants; changed import-detection and TODO counting to use the new functions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

skip:ci

Suggested reviewers

  • ShaharNaveh
  • moreal

Poem

🐰 I hop through code with whiskers twitching bright,
I trim one "test_" and keep the rest just right,
From AST forests to regex meadows I bound,
Counting todos and imports with a nimble sound,
A tiny rabbit cheering for changes found!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@youknowone youknowone merged commit a47572c into RustPython:main Feb 26, 2026
12 of 13 checks passed
@youknowone youknowone deleted the ast-revert branch February 26, 2026 18:55
@ShaharNaveh
Copy link
Contributor

Haven't thought about the CI of this feature. I'll reopen it (and won't skip CI this time 😓 )

ShaharNaveh added a commit to ShaharNaveh/RustPython that referenced this pull request Feb 27, 2026
youknowone pushed a commit that referenced this pull request Feb 28, 2026
* Reapply "`ast.NodeVisitor` for import tracking (#7229)" (#7230)

This reverts commit a47572c.
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.

2 participants