Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| return module | ||
|
|
||
|
|
||
| sys.modules.setdefault("pyunitwizard.main", _create_main_compat_module()) |
There was a problem hiding this comment.
Attach compatibility shim to package namespace
The new shim registers a pyunitwizard.main module with sys.modules.setdefault but never binds that module to the pyunitwizard package object. Because the entry already exists in sys.modules, import pyunitwizard.main completes without adding an attribute, so subsequent access still raises AttributeError. This breaks code that previously did import pyunitwizard.main followed by pyunitwizard.main.some_api. After creating the module you need to assign it to globals()["main"] (or otherwise expose it via the package) to retain the pre‑refactor behavior【F:pyunitwizard/init.py†L87-L87】
Useful? React with 👍 / 👎.
Summary
pyunitwizard.maincompatibility layer into the package initializermain.pymodule now that imports are redirected throughpyunitwizardis_quantityfrom the package exportsTesting
https://chatgpt.com/codex/tasks/task_e_69099912b49083269642cfd9c77cb935