You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes entry-points to be toml files
This also changes the auto-generation from decorator version
to create the entry-point files to use:
```
python -m spatch update-entrypoints file [file ...]
```
if you add the special:
```
[functions.auto-generation]
backend = "spatch._spatch_example.backend:backend1"
modules = ["spatch._spatch_example.backend"]
```
section to the entry-point file itself.
I really like this, plus the old abuse of black to format things nicely is fun.
TIL: `tomlkit` is really cool about editing toml files!
Note that we assume that `module` is the main `module` and any `.submodule`
is just a subdirectory within the same package.
I am not 100% sure if this is right, but since some tooling rejects
``/`` in entry-point values (to the extend that they break ALL
entry-point loading, not just ours!), we really can't rely on ``/``.
I am not 100% sure that this is always correct (i.e. I feel subpackages
are a thing now in principle, and those might not follow a directory
structure always?).
But, it seems practical enough, unless the entry-point validation is
changed.
(Or unless the packaging people explain why this is horrifying.)
* Apply suggestions from code review
* More fixes from review
Co-authored-by: Erik Welch <[email protected]>
---------
Signed-off-by: Sebastian Berg <[email protected]>
Co-authored-by: Erik Welch <[email protected]>
To extend an existing library with a backend, you need to define a `Python entry-point <https://packaging.python.org/en/latest/specifications/entry-points/>`_.
10
+
To extend an existing library with a backend, you need to define a
0 commit comments