◐ Shell
clean mode source ↗

CI runs update_lib by youknowone · Pull Request #6835 · RustPython/RustPython

📝 Walkthrough

Walkthrough

The PR introduces a new CI test step for update_lib tests and refactors NodeExprConstant from an autogenerated macro-based struct to a custom wrapper with a custom Initializer implementation that provides default initialization for the kind field.

Changes

Cohort / File(s) Summary
CI Workflow Update
.github/workflows/ci.yaml
Added new GitHub Actions step to run update_lib unit tests via cargo with PYTHONPATH set to scripts directory, positioned before the prettier install step
AST Node Initialization Refactoring
crates/vm/src/stdlib/ast/pyast.rs
Replaced autogenerated NodeExprConstant struct with custom wrapper struct NodeExprConstant(NodeExpr) and implemented custom Initializer trait to provide default kind = None initialization. Added PyO3 class attributes with HAS_DICT and BASETYPE flags, custom extend_class implementation for field/attribute definitions, and explicit slot initialization logic
Code Formatting
crates/vm/src/stdlib/ast/python.rs
Added blank line before final Ok(()) in NodeAst::slot_init method (formatting only, no logic changes)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • disallow __new__, __init__ #6446 — Shares the same initialization pattern refactoring for AST types using the Initializer trait to customize node construction behavior

Poem

🐰 A Constant node once grew plain,
Without a kind, through macro chain.
Now wrapped in custom Init's care,
With gentle defaults, clean and fair.
The AST hierarchy stands tall,
And initialization conquers all! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'CI runs update_lib' is vague and does not clearly describe the main changes. While it mentions CI and update_lib (relating to one commit), it omits the significant ast.Constant initialization fix which is substantial in scope and complexity. Consider revising to 'Fix ast.Constant initialization and add update_lib CI tests' or similar to accurately reflect both major components of this changeset.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.