How to limit my Anki add-on Version Support

I am new to writing add-ons.
How would I go about limiting my add-on, to say, Anki version 2.1.35 and have it not function on newer versions?


One way to do this is to use anki.version:

from anki import version

p = int(version.split(".")[-1])
if p > 35:
	# not supported
	# do something

Or, If you’re distributing the add-on as a .ankiaddon file, you can use the min_point_version key in the manifest file to make Anki refuse to install the add-on altogether on incompatible versions and notify the user.

AnkiWeb also provides a way to set the minimum version (I think it results in the same behavior as installing from .ankiaddon files though I’m not sure.)


Thank you for the quick answer, much appreciated!