Support #[cfg] in pymodule with by youknowone ยท Pull Request #6975 ยท RustPython/RustPython
Repository navigation
Support #[cfg] in pymodule with - #6975
Merged
youknowone merged 1 commit into RustPython:main from youknowone:cfg-with Feb 3, 2026
Merged
Support #[cfg] in pymodule with #6975 youknowone merged 1 commit into RustPython:main from youknowone:cfg-with
Conversation
youknowone
commented
Feb 3, 2026
·
edited by coderabbitai
Bot
Loading
Copy link Copy Markdown
Member
Summary by CodeRabbit
-
New Features
- Enhanced attribute parsing to support cfg-aware module items, enabling conditional inclusion of submodules.
-
Refactor
- Reworked module initialization and metadata assembly to honor cfg-gated with(...) entries across modules.
-
Bug Fixes
- Corrected platform gating for stdlib modules (ssl, time), removing unconditional stubs and fixing platform-specific exports.
coderabbitai
Bot
commented
Feb 3, 2026
·
edited
Loading
Copy link Copy Markdown
Contributor
|
Caution Review failedThe pull request is closed. ๐ WalkthroughWalkthroughRefactors pymodule attribute parsing: introduces Changes
Estimated code review effort๐ฏ 4 (Complex) | โฑ๏ธ ~45 minutes Possibly related PRs
Suggested reviewers
Poem๐ฅ Pre-merge checks | โ 3 โ Passed checks (3 passed)
โ๏ธ Tip: You can configure your own custom pre-merge checks in the settings. โจ Finishing touches
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. โค๏ธ ShareComment |
b221086 to
306d939
Compare
February 3, 2026 08:57 youknowone marked this pull request as ready for review February 3, 2026 09:39 coderabbitai
Bot
reviewed Feb 3, 2026
View reviewed changes
coderabbitai
Bot
left a comment
Copy link Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Actionable comments posted: 1
๐ค Fix all issues with AI agentsIn `@crates/derive-impl/src/pymodule.rs`:
- Around line 45-80: The parser for PyModuleArgs currently assigns to with_items
when it encounters a with(...) block, so later with(...) blocks overwrite
earlier ones; in the impl syn::parse::Parse for PyModuleArgs (the parse
function) change the handling inside the "if ident == \"with\"" branch to merge
parsed items into the existing with_items (use Vec::extend or similar on the
Vec<WithItem>) instead of replacing it, ensuring you still parse the trailing
comma and continue; reference the with_items local variable and the parse of
syn::punctuated::Punctuated::<WithItem,...>::parse_terminated(...) as the
locations to modify.
Support #[cfg] in with
fc13a9a
youknowone
force-pushed
the
cfg-with
branch
from
306d939 to
fc13a9a
Compare
February 3, 2026 09:55 youknowone merged commit
477e20a
into
RustPython : main
Feb 3, 2026
youknowone
deleted the
cfg-with
branch
February 3, 2026 09:56
coderabbitai
Bot
mentioned this pull request Feb 13, 2026 Use CRT functions for time module on Windows #7090 Merged This was referenced Feb 22, 2026 sys.monitoring #7197 Closed #[pymodule] submodule support and implicit module_name inheritance #7203 Merged youknowone added a commit that referenced this pull request Sep 16, 2026
Support #[cfg] in with (#6975)
3b956c8
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment