fix: stop shipping empty top-level wherobots/__init__.py (0.28.1)#69
Merged
Conversation
The dbapi source tree contained an empty `wherobots/__init__.py`, which hatchling included in the built wheel. `wherobots-python-sdk` (the Jobs SDK) ships its own non-empty `wherobots/__init__.py` re-exporting `WherobotsJob`, `WherobotsConfig`, the enums, models, etc. When both wheels are installed into the same environment they fight over that file. Whichever wheel pip installs last wins. In the common case (`pip install wherobots-python-dbapi wherobots-python-sdk`) dbapi's empty file wins and `from wherobots import WherobotsJob` raises ImportError. `from wherobots.db import ...` keeps working in both orders because submodule imports bypass the parent `__init__.py`, so dbapi-only consumers are not affected — and neither is `airflow-providers-wherobots`, which only uses `wherobots.db.*`. Remove the empty file so `wherobots/` becomes a PEP 420 implicit namespace package from dbapi's side. The Jobs SDK's real `__init__.py` remains the canonical one whenever both packages are installed. Verified with three install orderings — dbapi first, sdk first, both in one command — that `from wherobots import WherobotsJob` and `from wherobots.db import connect, Region` succeed in all of them after this change.
sfishel18
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wherobots/__init__.pyfrom the dbapi source tree.0.28.0→0.28.1.The bug
Both
wherobots-python-dbapi0.28.0 andwherobots-python-sdk0.2.0 claim ownership ofwherobots/__init__.py:WherobotsJob,WherobotsConfig, enums, models, …).When both wheels land in the same environment, whichever installs last wins. The default
pip install wherobots-python-dbapi wherobots-python-sdkordering puts dbapi last → its empty__init__.pyoverwrites sdk's →from wherobots import WherobotsJobraisesImportError.from wherobots.db import …keeps working in either order because submodule imports bypass the parent's__init__.py, so dbapi-only consumers (andairflow-providers-wherobots, which only useswherobots.db.*) aren't affected.The fix
Remove the empty file from dbapi's source.
wherobots/then becomes a PEP 420 implicit namespace package from dbapi's perspective; the Jobs SDK's__init__.pyis the canonical one whenever both packages are installed. dbapi's exports live entirely underwherobots.db.*, which is unaffected.Verified
Built the wheel locally and tested all three install orderings against
wherobots-python-sdk==0.2.0from PyPI:from wherobots import WherobotsJobfrom wherobots.db import connect, Regionpip installExisting tests: 72/72 unit tests pass.
Repro of the bug on the current PyPI release (before this PR)
Test plan
v0.28.1tag, confirmpip index versions wherobots-python-dbapishows0.28.1and the wheel contents no longer includewherobots/__init__.py