fix: relieve the requirement on init file #2553
Merged
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.
Background
prev a hub executor that introduces internal file dependencies must name its main logic file (where executor lies in) as
__init__.py
, more info https://github.com/jina-ai/jina-hub#-create-a-new-executorIf we don't call it as
__init__.py
, 1.x requires to import internal file dependencies asfrom jinahub.xxx
, more info here https://github.com/jina-ai/jina-hub#legacy-hub-pod-structureBoth solutions in 1.x aren't perfect.
__init__.py
should not be required, and in general Python, it is often left empty.This PR
This PR relieves the restriction on
__init__.py
and user will have the same developing & importing experience regardless if the executor is used in/out Hub.