This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
Fix python package and publish typing information #347
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.
TL;DR
Necessary init.py files were removed in #346
Type
Are all requirements met?
Complete description
The python protoc plugin does not leave
__init__.py
in the generated code, which makes it hard for code likesetuptools
to package the generated stub code. We do something similar in https://github.com/backup-test-123/protogen/blob/first-commit/generate_protos.py#L171-L181 and in this PR puts those files back and leave some code ingenerate_protos.sh
to generate those files.This PR also publishes the typing information contained in the pyi files by specifying them in the
package_data
section insetuptools.setup
.I tested this by producing a wheel and testing it on a clean virtual environment. Here's a screenshot of this PR working in emacs:
On the left I'm showing the existing model file defined in flytekit and on the right hand side we can see a script importing the stub directly and having access to the field named
closure
.Tracking Issue
Remove the 'fixes' keyword if there will be multiple PRs to fix the linked issue
fixes https://github.com/flyteorg/flyte/issues/
Follow-up issue
NA
OR
https://github.com/flyteorg/flyte/issues/