Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b148e43926
ℹ️ 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".
| if self.keep_global_variables and node.id in self.public_global_names: | ||
| return self.generic_visit(node) |
There was a problem hiding this comment.
Rename shadowed locals even when global name is public
The new public_global_names check skips every Name whose text matches a top-level assignment, but it does not account for scope. With keep_global_variables=True (the CLI default), a function-local variable that shadows a global can be renamed at assignment time while later reads are left unrenamed, changing runtime behavior (e.g., a local x assignment followed by print(x) can start reading the global x instead). This is a semantic regression introduced by the unconditional name-based early return.
Useful? React with 👍 / 👎.
| if fullname not in _M:return None | ||
| return _u.spec_from_loader(fullname,_L(fullname),is_package=fullname in _P) | ||
| _s.meta_path.insert(0,_F()) | ||
| for _m in {entry_modules!r}:__import__(_m) |
There was a problem hiding this comment.
Run bundled entrypoint as main
Bundle execution now imports each entry module with __import__, which runs module code under its module name instead of "__main__". As a result, standard guarded entry blocks (if __name__ == "__main__": ...) in bundled scripts no longer execute, so bundled output can silently do nothing where the original script previously ran. This is a behavior change in bundle mode and breaks common Python entrypoint patterns.
Useful? React with 👍 / 👎.
Summary
__init__re-exports, andimportlib-based internal importsWhy
The existing multi-file path only reliably handled straightforward
from module import namecases. More realistic package graphs broke in both package mode and bundle mode because import resolution and bundling were too simplistic.Validation
.venv/bin/python -m pytest.venv/bin/python -m build