Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure Python imports #22

Merged
merged 2 commits into from
Feb 24, 2022
Merged

Restructure Python imports #22

merged 2 commits into from
Feb 24, 2022

Conversation

whoahbot
Copy link
Contributor

  • Uses __all__ to provide an explicit index of the packagewhen doing from bytewax import *.

- Uses `__all__` to provide an explicit index of the package
  when doing `from bytewax import *`.
Copy link
Contributor

@davidselassie davidselassie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One question.


from .execution import run, spawn_cluster, run_cluster

__all__ = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with this. Is there a specific behavior you're hoping to cause or prevent with __all__? Otherwise isn't importing a symbol into __init__.py enough to cause it to be included in from bytewax import *?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct in that importing a symbol into __init__.py is enough to include it. I was attempting to carve out a few of the parts of our public API that were pulled in, like _run, but I just tested it and it didn't end up working anyway.

I think on closer inspection, I should skip using __all__. I'll update it.

Copy link
Contributor

@blakestier blakestier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Yay

@whoahbot whoahbot merged commit 39f271d into main Feb 24, 2022
@whoahbot whoahbot deleted the py_package_structure branch February 24, 2022 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants