Repository navigation
Honor no-site mode before importing site - #9045
Conversation
Extract the startup import_site guard from RustPython#8954. Preserve existing logging and comments, and cover the missing sys.modules behavior under -S in the existing sys snippet. Assisted-by: OpenAI Codex:model identifier unavailable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The change preserves -S startup behavior by avoiding the site import and adds a regression check. No actionable merge-blocking risk is identified. Pre-merge checks |
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ee5a6be60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sys.executable, | ||
| "-S", | ||
| "-c", | ||
| "import sys; assert sys.flags.no_site; assert 'site' not in sys.modules", |
There was a problem hiding this comment.
Remove the newly added test logic
The new subprocess assertion adds test logic to a test file, but the repository's critical AGENTS.md policy explicitly forbids modifying test assertions or test logic. Keep the production guard, but remove this regression block rather than changing extra_tests/snippets/stdlib_sys.py.
AGENTS.md reference: AGENTS.md:L273-L275
Useful? React with 👍 / 👎.
Summary
Extract the Python 3.14-compatible startup site-import guard from #8954. Honor the existing
import_sitesetting before importing site, preserving existing comments and error logging.One concise regression in the existing sys snippet checks that
-Sleaves site absent from sys.modules. Existing canonical tests cover flag acceptance and customization side effects, which do not catch this missing behavior.Validation
Extraction, regression and validation were AI-assisted with OpenAI Codex. Draft pending full hosted platform/workspace/CAPI CI and review. README unchanged.
Summary by CodeRabbit
-Snow reliably skips importingsite, consistent with the option’s behavior. Python’s startup flags correctly indicate thatsitewas not loaded.