Skip to content

Commit

Permalink
Adding the documentation section on how to setup the post-install for…
Browse files Browse the repository at this point in the history
… a given plugin.
  • Loading branch information
mikibonacci committed Jun 29, 2024
1 parent 49020f1 commit 0408c3d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/source/development/plugin_registry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ To include your plugin in the registry, follow these steps:
author: "Alice Doe"
github: "https://github.com/alicedoe/aiidalab-qe-xyz"
documentation: "https://aiidalab-qe-xyz.readthedocs.io/"
pip: "aiidalab-qe-xyz"
pip: "aiidalab-qe-xyz==version-of-the-code"
post-install: "post-install-command"
3. Submit a Pull Request. Direct it to `this repository's Pull Requests section <https://github.com/aiidalab/aiidalab-qe/pulls>`_.

Expand All @@ -37,10 +38,19 @@ Plugin Entry Requirements

- **github:** If provided, this should be the URL to the plugin's GitHub homepage.

At least one of ``github`` or ``pip`` is required.
At least one of ``github`` or ``pip`` is required. ``pip`` installation will be preferred if both are provided, and "==version-of-the-code" can be omitted (but strongly suggested, to ensure compatiblity).

- **pip:** The PyPI package name for your plugin, useful for installation via pip. Example: ``aiida-quantum``.
- **documentation:** The URL to your plugin's online documentation, such as ReadTheDocs.
- **author:** The developer of the plugin.
- **post-install:** a post install Command Line Interface (CLI) command which should be defined inside your plugin if you needs it. For example in the ``aiidalab-qe-vibroscopy`` plugin, we automatically setup the phonopy code via this command. See below for more explanations.

By following these guidelines, you can ensure your plugin is correctly listed and accessible within the AiiDAlab Quantum ESPRESSO app, facilitating its discovery and use by the community.
How to define a post install command in your plugin
---------------------------------------------------------------------

If you need to run a post-install command, you can define it in the CLI of your package, meant to be run as ``package-name post-install-command``.
You can define the CLI in the ``__main__.py`` (in your source folder) and ``pyproject.toml`` files. Have a look at the ``aiidalab-qe-vibroscopy`` plugin for an example on how to do this.
There, the automatic setup the phonopy code in the AiiDA database is implemented.
The command will be then triggered after the installation of the plugin (only) from the plugin list page of the Quantum ESPRESSO app.

By following these guidelines, you can ensure your plugin is correctly listed and accessible within the AiiDAlab Quantum ESPRESSO app, facilitating its discovery and use by the community.

0 comments on commit 0408c3d

Please sign in to comment.