-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update uuid
from 3.13.7
#6155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update uuid
from 3.13.7
#6155
Conversation
WalkthroughAdds a new Python-visible boolean attribute has_stable_extractable_node to the _uuid module by exporting a constant HAS_STABLE_EXTRACTABLE_NODE = false. No other logic or control flow is changed. Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
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 (1)
stdlib/src/uuid.rs (1)
11-15
: Avoid redundant get_mac_address() call (minor cleanup).The match arm discards the first result and calls
get_mac_address()
again; use the captured value instead.- match get_mac_address() { - Ok(Some(_ma)) => get_mac_address().unwrap().unwrap().bytes(), + match get_mac_address() { + Ok(Some(ma)) => ma.bytes(), // os_random is expensive, but this is only ever called once _ => rustpython_common::rand::os_random::<6>(), }
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
Lib/test/test_uuid.py
is excluded by!Lib/**
Lib/uuid.py
is excluded by!Lib/**
📒 Files selected for processing (1)
stdlib/src/uuid.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs
: Format Rust code with the default rustfmt style (runcargo fmt
)
Run clippy and fix any warnings or lints introduced by your changes
Follow Rust best practices for error handling and memory management
Files:
stdlib/src/uuid.rs
{vm,stdlib}/**/*.rs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use RustPython macros (
pyclass
,pymodule
,pyfunction
, etc.) when implementing Python functionality in Rust
Files:
stdlib/src/uuid.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). (11)
- GitHub Check: Run rust tests (macos-latest)
- GitHub Check: Run snippets and cpython tests (windows-2025)
- GitHub Check: Run snippets and cpython tests (ubuntu-latest)
- GitHub Check: Run snippets and cpython tests (macos-latest)
- GitHub Check: Run rust tests (ubuntu-latest)
- GitHub Check: Run rust tests (windows-2025)
- GitHub Check: Check Rust code with rustfmt and clippy
- GitHub Check: Run snippets and cpython tests on wasm-wasi
- GitHub Check: Check the WASM package and demo
- GitHub Check: Ensure compilation on various targets
- GitHub Check: Run tests under miri
🔇 Additional comments (1)
stdlib/src/uuid.rs (1)
34-35
: Align HAS_STABLE_EXTRACTABLE_NODE export with existing flag style or confirm CPython expectationhas_uuid_generate_time_safe is exported as #[pyattr] fn -> u32 while HAS_STABLE_EXTRACTABLE_NODE is a const bool (stdlib/src/uuid.rs:34–35). No Python-side uses found in this repo — confirm whether CPython's stdlib uuid.py expects an int (0/1) or a bool.
If CPython expects int (0/1) — replace with fn returning u32:
- #[pyattr(name = "has_stable_extractable_node")] - const HAS_STABLE_EXTRACTABLE_NODE: bool = false; + #[pyattr(name = "has_stable_extractable_node")] + fn has_stable_extractable_node(_vm: &VirtualMachine) -> u32 { + 0 + }If CPython expects bool — keep as-is.
Closes #5732
Summary by CodeRabbit