GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — Update `{site,sysconfig}.py` from 3.13.7 by ShaharNaveh · Pull Request #6132 · RustPython/RustPython Conversation
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughAdds a new internal stdlib module Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App
participant VM
participant StdlibRegistry as "Stdlib Init Map"
participant Sysconfig as "_sysconfig Module"
App->>VM: import _sysconfig
VM->>StdlibRegistry: lookup make_module("_sysconfig")
StdlibRegistry-->>VM: sysconfig::make_module
VM->>Sysconfig: initialize module
VM-->>App: _sysconfig handle
App->>Sysconfig: config_vars()
activate Sysconfig
Note over Sysconfig: Build dict {"Py_GIL_DISABLED": True}
Sysconfig-->>App: PyDict
deactivate Sysconfig
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ 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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
vm/src/stdlib/sysconfig.rs (2)
1-4: Avoid a redundantsysconfig::sysconfigpath; use a conventional inner module name.Align with existing pattern (
module/decl) to improve clarity.-pub(crate) use sysconfig::make_module; - -#[pymodule(name = "_sysconfig")] -pub(crate) mod sysconfig { +pub(crate) use module::make_module; + +#[pymodule(name = "_sysconfig")] +pub(crate) mod module {
7-13: Return PyResult and drop unwrap for better error hygiene.Matches common style in stdlib shims and keeps exceptions propagatable.
- #[pyfunction] - fn config_vars(vm: &VirtualMachine) -> PyDictRef { - let vars = vm.ctx.new_dict(); - vars.set_item("Py_GIL_DISABLED", false.to_pyobject(vm), vm) - .unwrap(); - vars - } + use crate::PyResult; + + #[pyfunction] + fn config_vars(vm: &VirtualMachine) -> PyResult<PyDictRef> { + let vars = vm.ctx.new_dict(); + vars.set_item("Py_GIL_DISABLED", vm.ctx.new_bool(false), vm)?; + Ok(vars) + }
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration.
Lib/site.py is excluded by !Lib/**Lib/sysconfig/__init__.py is excluded by !Lib/**Lib/sysconfig/__main__.py is excluded by !Lib/**Lib/test/test_site.py is excluded by !Lib/**Lib/test/test_sysconfig.py is excluded by !Lib/**vm/src/stdlib/mod.rs (2 hunks)vm/src/stdlib/sysconfig.rs (1 hunks)📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs: Follow the default rustfmt code style (cargo fmtto 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:
vm/src/stdlib/mod.rsvm/src/stdlib/sysconfig.rsvm/src/stdlib/nt.rs (1)
make_module(7-11)vm/src/stdlib/time.rs (1)
make_module(10-17)
vm/src/stdlib/mod.rs (2)
21-21: Wiring the new stdlib module looks correct.Unconditional
mod sysconfig;is consistent with other always-available stdlib shims.
101-101: Registered initializer for "_sysconfig".Entry points to
sysconfig::make_moduleas expected; ordering among other entries is fine.vm/src/stdlib/sysconfig.rs (1)
7-13: Verify that all required sysconfig config_vars keys are provided
Could not locate the vendored Python 3.13.7sysconfig.pyin this repo; please manually confirm that no additional keys beyondPy_GIL_DISABLEDare expected byconfig_varsto prevent runtime failures.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # See https://bugs.python.org/issue29585 | ||
|
|
||
| # Copy of sysconfig._get_implementation() | ||
| def _get_implementation(): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👍 finally this is shipped
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.