[Qgis-developer] QGis.QGIS_VERSION_INT not defined for master: breaks plugins

Nyall Dawson nyall.dawson at gmail.com
Fri Jul 29 22:19:56 PDT 2016


On 30 July 2016 at 03:39, Richard Duivenvoorde <rdmailings at duif.net> wrote:
>
> Hi,
>
> This commit
> https://github.com/qgis/QGIS/commit/1a2231f10c65c2bef992e02046baebf3bc4975f6
>
> in master renames 'QGis' to 'Qgis', bringing more consistency in
> capitalization, which is good \o/
>
> But it breaks some Python plugins,  which (often to be backwards
> compatible) check for: "QGis.QGIS_VERSION_INT". These now all throw
> exceptions that QGis is not available.

I'm suprised it's taken this long for things to break ;) But most
likely (non-core) plugins were broken before this, just in more subtle
ways...

>
> Some notable plugins:
>
> plugin_reloader, some of mine, timemanager, qconsolidate, but a lot more...
>
> Off course the plugins should be fixed (because of this and other api
> breaks), but I still wonder how to proceed:
> - try to make (my) plugins work for both (some 'import QGis as Qgis'
> within a try clause.
> - not update 2.x versions anymore, and focus on 3.0

I'd say it's probably still too early to start updating plugins for
3.0. These breaks are likely to be an iterative thing - ie if you
start updating now, you'll likely have to duplicate work as other
parts of the API breaks are implemented.

Better to instead keep an eye on the api break documentation so that
you're aware of what's changing (also my blog series at
http://north-road.com/blog/), but hold off on actually making any
changes yet.

I'd also say it's pointless to try to make a plugin compatible with
both 2.x and 3.0 - there'll be so many if/else branches that it'll
become unmaintable. When it's time to port to 3.0, i'd suggest forking
first.

Nyall


>
> Easiest for me/other plugin devs is the second option, BUT we need a
> clear path then for the two different ('latest') versions which should
> be available then at plugins.qgis.org
> Not sure if plugins-site can handle this already (Alessandro?)?
>
> Or is there another alternative, or plan?
>
> Regards,
>
> Richard Duivenvoorde
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list