Repository navigation
Use __main__ for filesystem script compiler warnings - #9301
Conversation
Forward script compiler warnings through the typed module-aware entry point. Sync canonical command-line script coverage from CPython d220409a13b77de7a6c30abe16ea90db01528edc with the existing RustPython marker preserved. Assisted-by: OpenAI Codex:model-version-unavailable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_bytes.py (TODO: 12) dependencies: dependent tests: (no tests depend on bytes) [x] test: cpython/Lib/test/test_cmd_line_script.py (TODO: 1) dependencies: dependent tests: (no tests depend on cmd_line_script) [ ] lib: cpython/Lib/bdb.py dependencies:
dependent tests: (2 tests)
[ ] lib: cpython/Lib/modulefinder.py dependencies:
dependent tests: (2 tests)
[ ] lib: cpython/Lib/pdb.py dependencies:
dependent tests: (1 tests)
[ ] lib: cpython/Lib/codeop.py dependencies:
dependent tests: (112 tests)
Legend:
|
Merging this PR will improve performance by 11.01%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
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: a0c88bfdfc
ℹ️ 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".
| with os_helper.temp_dir() as script_dir: | ||
| script_name = _make_test_script(script_dir, 'script') | ||
| py_compile.compile(script_name, doraise=True) | ||
| pyc_file = import_helper.make_legacy_pyc(script_name, allow_compile=True) |
There was a problem hiding this comment.
Revert non-marker edits to the regression tests
This helper replacement rewrites an existing regression test's compilation setup, and the commit repeats the same non-marker edit in other test bodies. The repository's test policy explicitly forbids modifying test logic and permits only expected-failure marker changes, so revert these body edits and keep the functional change in Rust.
AGENTS.md reference: AGENTS.md:L278-L282
Useful? React with 👍 / 👎.
Summary
Pass
__main__to the module-aware compiler when executing a filesystem source script. Previously,-Walways:::__main__could not override-Werrorfor those compiler warnings, causing a valid script to fail withSyntaxError: invalid decimal literal.This extracts the script-warning fix from #8954 using the typed compiler wrapper preserved by #9294. It does not change warning ordering, execution globals, bytecode loading,
run_string, or zip/runpy execution.Sync
Lib/test/test_cmd_line_script.pywithscripts/update_lib migratefrom CPythond220409a13b77de7a6c30abe16ea90db01528edc. The resulting file matches the mega branch and retains the existing Android/Linuxtest_non_asciiexpected-failure adaptation. No assertions or expected warning counts were weakened.Validation
Tested on
1ba110711575d65bb64e85d4e302fd2a8a105887; the patch also merges cleanly with current maineb03691084b0366381405ba732cf5ebd0e5518b0. The merged #9296 compiler-ordering change was reviewed for source composition, but this combined tree has not been locally executed.capipassed.VM checks passed with default host-environment features plus
threading, and with--no-default-features --features compiler. VM all-targets Clippy withthreadingand-D warningspassed. Full workspace/C-API test suites and Windows/macOS/mobile/non-host-environment runtime testing were not run. The runtime comparison uses the stated base, not a claim that all current-main library changes were tested.AI assistance: implementation, source review, and validation were assisted by OpenAI Codex; the commit includes an
Assisted-bytrailer.Summary by CodeRabbit