Skip to content

Conversation

@youknowone
Copy link
Member

and also ensure RustPython is compatible to update_lib

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 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.

@youknowone youknowone marked this pull request as ready for review January 22, 2026 14:04
@youknowone youknowone merged commit 11a59bb into RustPython:main Jan 22, 2026
13 checks passed
@youknowone youknowone deleted the updatelib-ci branch January 22, 2026 15:57
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