-
Notifications
You must be signed in to change notification settings - Fork 301
Initial PR demonstrating public API export logic. #747
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
Conversation
build.py
Outdated
namex.generate_api_files(package, code_directory="src", verbose=True) | ||
|
||
# Make sure to export the __version__ string | ||
from keras_nlp.src import __version__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to escape the lint error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add # noqa
to the end of the line.
Or maybe # noqa (ignore import lint error)
to be a little more readable.
I updated the PR -- how do you want to proceed? Should we just add the |
setup.py
Outdated
"tensorflow-text; platform_system != 'Darwin'", | ||
], | ||
extras_require={ | ||
"build": ["namex"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just move this to requirements.txt
@fchollet when I try to run this naively, e.g.
I get a weird infinite recursion. E.g.
And eventually a max recursion depth error. Am I doing something wrong in setup? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR demonstrates how public API export would work:
namex
at build time to generate a package that only includes public symbols.To create the package, simply run
python3 build.py
instead ofpython3 -m build
. The resulting artifacts can then be collected fromdist/
as usual.TODO: export all public API symbols. Right for we only export one (
TransformerEncoder
) for demonstration purposes.