meson-python icon indicating copy to clipboard operation
meson-python copied to clipboard

DOC: add some documentation on how to use entry points

Open daknuett opened this issue 1 year ago • 3 comments

This fixes #500 and discussion #501.

I have tested the example code.

Thanks to @dnicolodi .

daknuett avatar Sep 21 '23 10:09 daknuett

docs/tutorials/entrypoints.rst is not linked to the documentation index, thus the proposed changes have no effect. Anyhow, I find the proposed addition way to heavy to describe the use of entry points, for which I'm pretty sure we don't need a whole tutorial. I think that a simple paragraph somewhere stating that meson-python implements https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata is enough.

dnicolodi avatar Sep 21 '23 11:09 dnicolodi

@FFY00 what are your thoughts? I just implemented parts of the stub.

daknuett avatar Sep 22 '23 07:09 daknuett

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.entry-points] table but that you must repeat it. E.g., for numpy:

[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.

rgommers avatar Oct 07 '23 06:10 rgommers