When Blender is loading add-ons, it first parses the bl_info
block (addon_utils.py) of your script entry point (either __init__ or the single .py file), then later on it checks if the add-on has a compatible version (space_userpref.py).
In order to make your add-on more convenient to download, with a single archive (without having to distribute separate 2.79, 2.83, 2.90 etc. downloads), would it be too crazy to do something like this:
# Notice the super-high major version.
bl_info = {
'name': 'My Awesome Add-on',
'author': 'John Doe',
'description': 'Description',
'version': (1, 0, 0),
'blender': (999,),
'location': 'Menu > Foo > Bar',
'warning': '',
'category': '3D View',
}
import bpy
def register():
major, minor = bpy.app.version[:2]
if major == 2:
if minor == 83:
# Import your 2.83 package.
from _283 import _register
_register()
elif minor == 79:
# Import your 2.79 package.
from _279 import _register
_register()
else:
pass
elif major == 3:
(...)
I tested and it works. The benefit of this would be that you can distribute a single ZIP with all the scripts inside, and the add-on only registers the classes needed based on the Blender version registering the add-on.