Develop against a local plugins_api
By default, madbot installs plugins-api from the GitLab package registry: a fresh clone, a test installation or a server needs nothing else. When you change plugin_api/ itself and want madbot to run your changes, switch to your local checkout.
This page assumes the development setup.
Use the local checkout
Section titled “Use the local checkout”In api/.env:
MADBOT_PLUGIN_API_LOCAL=truepixi reads it each time it activates an environment and puts your local plugin_api/ ahead of the installed package. The setting applies from the next pixi run or pixi shell, to every pixi environment, until you set it back to false.
To use the other source for a single command, for example to run the tests against the released package:
MADBOT_PLUGIN_API_LOCAL=false pixi run testThe local checkout is the plugin_api folder next to api/. To use another folder, set MADBOT_PLUGIN_API_DIR in api/.env, as a path relative to the root of the repository.
Check which source is in use
Section titled “Check which source is in use”pixi run list-pluginsThe released plugins-api package stays installed underneath, so pixi list keeps showing its version. Trust the plugins-api source line printed by pixi run list-plugins, and at the end of every pixi run install-plugins.
Add a dependency to plugins_api
Section titled “Add a dependency to plugins_api”pixi resolves the dependencies of the released plugins-api, not those of your checkout. A dependency you add to plugin_api/pyproject.toml is not installed, and its import fails when madbot runs. Until a release of plugins-api declares it, install it in both environments yourself:
pixi run -e default pip install <package>pixi run -e dev pip install <package>This leaves pixi.lock untouched, as it should for a dependency that is not released yet. Once the new plugins-api is published and its version range is raised in api/pyproject.toml, pixi installs the dependency itself.
A local source that does not go away
Section titled “A local source that does not go away”If pixi run list-plugins reports a local source while MADBOT_PLUGIN_API_LOCAL is false, the environment may still hold a copy of plugins-api installed by hand, for example with pip install -e ../plugin_api. It overrides the setting. pixi run install-plugins detects it and asks to run the pixi reinstall plugins-api commands that remove it.

