How to mark plugin incompatible with certain versions of Octoprint

The next release of my plugin relies on Octoprint >= 1.6.0 as it has a new feature that my plugin now requires.

I did lots of searching but I didn't really see anyway to prevent your plugin from being downloaded and installed if the user's Octoprint version was not compatible with the plugin.

There's a number of ways that you can make it so that the plugin doesn't show up for users, doesn't install and doesn't load.

You can set the required version of OctoPrint in the plugin repository, under the compatibility data. This means that users without a compatible version will not be able to install it from the official repository.

Because people don't always read, they may want to install the plugin direct from a URL. To combat this you can test the requirements in your file by importing from octoprint.util.version to test compatibility:

Finally, if you don't want to block the install, you can prevent loading by implementing a __plugin_check__ control property and doing the same test as above. Control Properties β€” OctoPrint master documentation


You can also do a staged/branch approach and allow older version to be locked from updates to a compatible version octoprint. I've got the first stage for this completed on one of my plugins. Next release will only go to octoprint 1.6.0 or newer, similar to what you need.