GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update xml from 3.13.7 by ShaharNaveh · Pull Request #6100 · RustPython/RustPython

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented Aug 17, 2025 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • The pyexpat module now exposes a version_info attribute returning the module version as a tuple (2, 7, 1), allowing scripts to detect pyexpat’s exact version at runtime for compatibility checks and conditional logic.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ShaharNaveh
Update xml from 3.13.7
8249938
@coderabbitai

coderabbitai Bot commented Aug 17, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Walkthrough

Replaces the module header block comment with a Rust doc comment and introduces a new Python-facing attribute by adding #[pyattr(name = "version_info")] pub const VERSION_INFO: (u32, u32, u32) = (2, 7, 1); inside #[pymodule(name = "pyexpat")] mod _pyexpat in stdlib/src/pyexpat.rs.

Changes

Cohort / File(s) Summary
pyexpat module updates
stdlib/src/pyexpat.rs
Converted header block comment to a Rust doc comment and added #[pyattr(name = "version_info")] pub const VERSION_INFO: (u32, u32, u32) = (2, 7, 1); at module scope within #[pymodule(name = "pyexpat")] mod _pyexpat.

Sequence Diagram(s)

sequenceDiagram
  participant Py as Python code
  participant Mod as _pyexpat module
  participant Const as VERSION_INFO

  Py->>Mod: access attribute `version_info`
  Mod->>Const: read constant (module-level)
  Const-->>Mod: (2, 7, 1)
  Mod-->>Py: return (2, 7, 1)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops in lines of byte,
Pins a tuple neat and bright.
(2, 7, 1) in plain sight,
Doc comment gleams, the module's right.
Carrot hops — code done, good night. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 76b65a2 and a4dbfa9.

📒 Files selected for processing (1)
  • stdlib/src/pyexpat.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • stdlib/src/pyexpat.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Run rust tests (windows-latest)
  • GitHub Check: Run snippets and cpython tests on wasm-wasi
  • GitHub Check: Check the WASM package and demo
  • GitHub Check: Run snippets and cpython tests (windows-latest)
  • GitHub Check: Run snippets and cpython tests (macos-latest)
  • GitHub Check: Run rust tests (ubuntu-latest)
  • GitHub Check: Run snippets and cpython tests (ubuntu-latest)
  • GitHub Check: Ensure compilation on various targets
  • GitHub Check: Run rust tests (macos-latest)
  • GitHub Check: Check Rust code with rustfmt and clippy
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 17, 2025
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
stdlib/src/pyexpat.rs (2)

1-1: Use inner module doc comments (//!) at the crate/module root

At the top of a module/file, prefer //! so the doc attaches to the module itself rather than the next item.

-/// Pyexpat builtin module
+//! Pyexpat builtin module

42-49: Expose version tuple efficiently; drop PyInt dependency

Implementation is correct. You can simplify by using vm.ctx.new_int(...) to avoid importing PyInt and the extra into_pyobject conversions.

-    #[pyattr]
-    pub fn version_info(vm: &VirtualMachine) -> PyTupleRef {
-        vm.ctx.new_tuple(vec![
-            PyInt::from(2).into_pyobject(vm),
-            PyInt::from(7).into_pyobject(vm),
-            PyInt::from(1).into_pyobject(vm),
-        ])
-    }
+    #[pyattr]
+    pub fn version_info(vm: &VirtualMachine) -> PyTupleRef {
+        vm.ctx.new_tuple(vec![
+            vm.ctx.new_int(2).into(),
+            vm.ctx.new_int(7).into(),
+            vm.ctx.new_int(1).into(),
+        ])
+    }

If you adopt the above, you can also remove PyInt from the imports:

-        builtins::{PyInt, PyStr, PyStrRef, PyTupleRef, PyType},
+        builtins::{PyStr, PyStrRef, PyTupleRef, PyType},
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a9a9e3b and 8249938.

⛔ Files ignored due to path filters (13)
  • Lib/test/test_xml_dom_xmlbuilder.py is excluded by !Lib/**
  • Lib/test/test_xml_etree.py is excluded by !Lib/**
  • Lib/test/test_xml_etree_c.py is excluded by !Lib/**
  • Lib/xml/dom/expatbuilder.py is excluded by !Lib/**
  • Lib/xml/dom/minidom.py is excluded by !Lib/**
  • Lib/xml/dom/xmlbuilder.py is excluded by !Lib/**
  • Lib/xml/etree/ElementInclude.py is excluded by !Lib/**
  • Lib/xml/etree/ElementPath.py is excluded by !Lib/**
  • Lib/xml/etree/ElementTree.py is excluded by !Lib/**
  • Lib/xml/sax/__init__.py is excluded by !Lib/**
  • Lib/xml/sax/_exceptions.py is excluded by !Lib/**
  • Lib/xml/sax/expatreader.py is excluded by !Lib/**
  • Lib/xml/sax/xmlreader.py is excluded by !Lib/**
📒 Files selected for processing (1)
  • stdlib/src/pyexpat.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

**/*.rs: Follow the default rustfmt code style (cargo fmt to format)
Always run clippy to lint code (cargo clippy) before completing tasks. Fix any warnings or lints that are introduced by your changes
Follow Rust best practices for error handling and memory management
Use the macro system (pyclass, pymodule, pyfunction, etc.) when implementing Python functionality in Rust

Files:

  • stdlib/src/pyexpat.rs
🧬 Code Graph Analysis (1)
stdlib/src/pyexpat.rs (2)
vm/src/builtins/str.rs (10)
  • from (126-128)
  • from (132-134)
  • from (138-140)
  • from (144-146)
  • from (150-152)
  • from (156-158)
  • from (162-164)
  • from (168-170)
  • from (174-176)
  • from (180-182)
vm/src/builtins/int.rs (1)
  • into_pyobject (56-58)
🔇 Additional comments (2)
stdlib/src/pyexpat.rs (2)

32-32: LGTM: Imports expanded appropriately for new attribute

Adding PyInt and PyTupleRef is correct for constructing the tuple in version_info. No issues spotted.


42-49: Confirm attribute naming parity with CPython’s pyexpat API

I ran a repo-wide search for any existing references to pyexpat.version_info, expat_version_info, expat_version, or EXPAT_VERSION and found none. Please verify that:

  • pyexpat.version_info is the intended public name for this 3.13.7 sync
  • No existing code/tests elsewhere depend on a different attribute name
  • If matching CPython’s API is required, consider exporting one or more of the following aliases for compatibility:
    • pyexpat.expat_version
    • pyexpat.expat_version_info
    • pyexpat.EXPAT_VERSION

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
youknowone
youknowone reviewed Aug 20, 2025
View reviewed changes
Comment thread stdlib/src/pyexpat.rs Outdated
Comment on lines +43 to +49
pub fn version_info(vm: &VirtualMachine) -> PyTupleRef {
vm.ctx.new_tuple(vec![
PyInt::from(2).into_pyobject(vm),
PyInt::from(7).into_pyobject(vm),
PyInt::from(1).into_pyobject(vm),
])
}

@youknowone youknowone Aug 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Suggested change
pub fn version_info(vm: &VirtualMachine) -> PyTupleRef {
vm.ctx.new_tuple(vec![
PyInt::from(2).into_pyobject(vm),
PyInt::from(7).into_pyobject(vm),
PyInt::from(1).into_pyobject(vm),
])
}
pub fn version_info(_vm: &VirtualMachine) -> (u32, u32, u32) {
(2, 7, 1)
}

This may work

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
youknowone
youknowone requested changes Aug 20, 2025
View reviewed changes
Comment thread stdlib/src/pyexpat.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

ShaharNaveh and others added 2 commits August 20, 2025 13:16
@ShaharNaveh @youknowone
Update stdlib/src/pyexpat.rs
76b65a2
Co-authored-by: Jeong, YunWon <[email protected]>
@ShaharNaveh
Fix clippy
a4dbfa9
@ShaharNaveh
ShaharNaveh requested a review from youknowone August 20, 2025 13:17
youknowone
youknowone approved these changes Aug 21, 2025
View reviewed changes
@youknowone
youknowone merged commit 9417e10 into RustPython:main Aug 21, 2025
@youknowone youknowone mentioned this pull request Dec 4, 2025
Update Python libraries and tests from Python 3.13 #5529
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ShaharNaveh @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.