-
Notifications
You must be signed in to change notification settings - Fork 69
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
DOC: add some documentation on how to use entry points #502
base: main
Are you sure you want to change the base?
Conversation
|
@FFY00 what are your thoughts? I just implemented parts of the stub. |
Entrypoints were not completely trivial to figure out when I needed them for NumPy, and the upstream docs are not very good for a user (and painfully formatted). So a small worked example would be nice to have in my opinion. I'd be happy to review this PR and get it merged. This is a bit long on boilerplate though, and too short on the different types of entry points. TOML is also a bit weird here in that there's not a single [project.scripts]
f2py = 'numpy.f2py.f2py2e:main'
[project.entry-points.array_api]
numpy = 'numpy.array_api'
[project.entry-points.pyinstaller40]
hook-dirs = 'numpy:_pyinstaller_hooks_dir' I'll add an initial review. |
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.
Thanks for writing this @daknuett. I added some suggestions. In addition, you have to uncomment the entry for this file in doc/index.rst
so the doc build includes it.
docs/tutorials/entrypoints.rst
Outdated
|
||
[project.scripts] | ||
simpleapp = "simpleapp.console:main" | ||
|
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 suggest adding two project.entry-points.NAME
entries, that will be instructive. I suggest using the actual ones from numpy (pyinstaller40
and array_api
), because those are real-world things. The actual implementation can be a one-liner, something like:
print("You discovered the PyInstaller plugin for simpleapp")
This fixes #500 and discussion #501.
I have tested the example code.
Thanks to @dnicolodi .