Repository navigation
Fix stale public exports blocking wildcard imports - #686
Conversation
hameerabbasi
left a comment
There was a problem hiding this comment.
Please import things where possible instead of deleting from __all__.
|
Thanks for the review. I updated the existing PR branch in I restored the two names that are available from public submodules: Validation: Posted on behalf of @Doribelove by OpenAI Codex (GPT-6, autonomous). Codex generated this review-round change, tests, and response and ran the checks above. |
| exec("from finch import *", namespace) | ||
|
|
||
| for name in finch.__all__: | ||
| assert namespace[name] is getattr(finch, name) |
There was a problem hiding this comment.
We don't need these two tests anymore.
There was a problem hiding this comment.
Removed both test_existing_public_exports_stay_available and test_star_import_exposes_public_names, together with the unused imports, in 61419bbc. The test file now contains only the suggested availability and sorted-unique invariant.
Validation: the public-export and interface tests report 3,093 passed and 54 skipped; Ruff 0.16.8 check/format and git diff --check pass. The PR description now reflects the final test coverage.
Posted on behalf of @Doribelove by OpenAI Codex (GPT-6, autonomous). Codex prepared this test-only revision and response and ran the checks above.
|
I checked the newly completed The benchmark and validator files are byte-for-byte unchanged from this PR's pre-export-change baseline, Upstream 431a36f / #665 has since removed the Investigation performed with Codex assistance. |
|
Please rebase; that should cause the Julia benchmark failure to go away. |
Signed-off-by: 李永祺 <[email protected]>
Restore the existing Reflector and element_type exports from their public submodules. Keep unavailable property names out of __all__, normalize its static order and duplicates, and cover availability, uniqueness, and wildcard imports. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]>
Remove the redundant object identity and wildcard import tests, along with their unused imports, as requested in review. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]>
Remove the RUF022 suppression and redundant ordering assertion as requested in review. Preserve export availability and uniqueness checks. Validate 3093 public-export and interface tests, with 54 skips, and all repository pre-commit hooks. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]>
61419bb to
280a1ec
Compare
* Fix stale public exports blocking wildcard imports Signed-off-by: 李永祺 <[email protected]> * Preserve importable public exports and validate the export list Restore the existing Reflector and element_type exports from their public submodules. Keep unavailable property names out of __all__, normalize its static order and duplicates, and cover availability, uniqueness, and wildcard imports. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep the requested public export invariant test Remove the redundant object identity and wildcard import tests, along with their unused imports, as requested in review. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep Ruff export ordering after rebasing main Remove the RUF022 suppression and redundant ordering assertion as requested in review. Preserve export availability and uniqueness checks. Validate 3093 public-export and interface tests, with 54 skips, and all repository pre-commit hooks. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> --------- Signed-off-by: 李永祺 <[email protected]>
* Fix stale public exports blocking wildcard imports Signed-off-by: 李永祺 <[email protected]> * Preserve importable public exports and validate the export list Restore the existing Reflector and element_type exports from their public submodules. Keep unavailable property names out of __all__, normalize its static order and duplicates, and cover availability, uniqueness, and wildcard imports. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep the requested public export invariant test Remove the redundant object identity and wildcard import tests, along with their unused imports, as requested in review. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep Ruff export ordering after rebasing main Remove the RUF022 suppression and redundant ordering assertion as requested in review. Preserve export availability and uniqueness checks. Validate 3093 public-export and interface tests, with 54 skips, and all repository pre-commit hooks. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> --------- Signed-off-by: 李永祺 <[email protected]>
…ngs (#703) * fixing LRU implementation * precommit error fixing * cached_matrix form implemented * [pre-commit.ci] pre-commit autoupdate (#712) updates: - [github.com/astral-sh/ruff-pre-commit: v0.16.9 → v0.16.10](astral-sh/ruff-pre-commit@v0.16.9...v0.16.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * `pixi update` and fix new `ty` lints (#710) * `pixi update` * Fix type checking errors caught by new version of `ty`. * Memory Management for MLIR (#685) * Added dev_doc.md for mlir codegen * First draft of memref_buffer * Edit: added sparse output and finished memeory management * fix description * Added test for memrefbuffer * Fin * Add sponsors section to README (#714) Added sponsors section with acknowledgments for NSF and Codspeed. * Update sponsorship section in README.md (#715) * Fix stale public exports blocking wildcard imports (#686) * Fix stale public exports blocking wildcard imports Signed-off-by: 李永祺 <[email protected]> * Preserve importable public exports and validate the export list Restore the existing Reflector and element_type exports from their public submodules. Keep unavailable property names out of __all__, normalize its static order and duplicates, and cover availability, uniqueness, and wildcard imports. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep the requested public export invariant test Remove the redundant object identity and wildcard import tests, along with their unused imports, as requested in review. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> * Keep Ruff export ordering after rebasing main Remove the RUF022 suppression and redundant ordering assertion as requested in review. Preserve export availability and uniqueness checks. Validate 3093 public-export and interface tests, with 54 skips, and all repository pre-commit hooks. Assisted-by: OpenAI Codex (model: GPT-6, autonomous) Signed-off-by: 李永祺 <[email protected]> --------- Signed-off-by: 李永祺 <[email protected]> * precommig * fix --------- Signed-off-by: 李永祺 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hameer Abbasi <[email protected]> Co-authored-by: Yu Sheng <[email protected]> Co-authored-by: Willow Ahrens <[email protected]> Co-authored-by: Dori <[email protected]> Co-authored-by: Willow Ahrens <[email protected]>
from finch import *fails because the top-level__all__advertises names that are not bound onfinch. This also preventssparsefrom importing its Finch backend, which uses a wildcard Finch import.Restore
Reflectorandelement_typeas top-level exports from their existing public submodules. Remove the three names without module-level objects (extent,fill_value, andshape_type) and remove duplicate entries.Following review, keep Ruff's ordering of
__all__and remove the localRUF022suppression. The regression test checks that every advertised name exists and that there are no duplicates; ordering is enforced by Ruff. The resulting diff against currentmaintouches only two files, with 8 insertions and 11 deletions.Validation
Rebased onto
mainat819923917af8dcad3eb201107974ccd4eafa13f3; current head280a1ec71c9f624bf9f0317dc21a93abe6e241eb. Checks used Linux and Python 3.12.14 against the actual source tree.python -m pytest src/finch/tests/test_public_exports.py src/finch/tests/test_interface.py --no-cov -q: 3,093 passed, 54 skipped.git diff --check: passed.The original wildcard-import reproduction failed on unchanged source with an unavailable export, then passed with the export fix. The current rebase includes upstream's removal of the old automatic
benchmark-juliajob. On the new head, pre-commit.ci passes; GitHub CI, Docs and Benchmark workflows areaction_required, awaiting workflow approval. These are not reported as test failures. The complete backend/platform matrix has not been run locally.AI assistance: Codex prepared the implementation, test, review revisions and description. The reported local checks were executed.