Minimal template repository for writing a Python plugin for AllayStone.
This repository is meant to be copied with GitHub's template feature and then renamed for your plugin.
Update these places first:
pyproject.tomlsrc/allaystone_template/src/allaystone_template/plugin.py
- Change
[project].nameinpyproject.tomltoallaystone-<your-plugin-name>. - Change
[project.entry-points.allaystone]so the key is your plugin name and the value points to your new module and class. - Rename
src/allaystone_template/to your package name. - Rename
TemplatePlugininsrc/allaystone_template/plugin.pyto your real plugin class name. - Update
version,api_version,description,authors, andwebsite.
The distribution name must keep the allaystone- prefix or AllayStone will not load it.
AllayStone publishes a wheel containing the generated allay.api stubs and the allaystone helper package.
Install it from an AllayStone release if you want autocomplete and type hints in your editor:
python -m pip install https://github.com/smartcmd/AllayStone/releases/download/<tag>/<wheel-file>.whlpython -m pip wheel . --no-deps --wheel-dir distCopy the generated wheel from dist/ into your server's plugins/ directory.
This template includes .github/workflows/build.yml.
- pushes to
main, pull requests, and manual runs build a wheel and upload it as a workflow artifact - published GitHub releases also attach the built wheel to the release assets
If you want a downloadable wheel for each version, create a tag and publish a GitHub release from that tag.
python -m pip install -e . --prefix <server>/plugins/.localFor ./gradlew runServer, the managed prefix is usually build/run/plugins/.local.
Stop the server first, then uninstall the distribution from the same prefix:
& { $env:PYTHONPATH = "<server>/plugins/.local/Lib/site-packages"; try { python -m pip uninstall allaystone-<your-plugin-name> } finally { Remove-Item Env:PYTHONPATH -ErrorAction SilentlyContinue } }src/allaystone_template/plugin.py contains the minimal plugin entry class. It shows:
- lifecycle hooks:
on_load(),on_enable(),on_disable() - how to use
self.logger - how to write files into
self.data_folder
After you finish renaming the template, build a wheel and copy it into an Allay server that already has the AllayStone jar installed.
On startup, the example implementation writes a marker file into plugins/<plugin-name>/.