[QGIS-Developer] QgsLocator & common python libs
Luigi Pirelli
luipir at gmail.com
Fri Apr 6 02:49:55 PDT 2018
I strongly agree with Nyall analysis about versioning. We had similar
problems in Boundless when adding new features to already available
modules... there weren't a simple way to load a specific module version,
especially when these different version are available in different python
plugins all listed in the pythonpath.
The simples solution was to version the module from qgiscommon to
qgisocmmon2 and rebuild all in-house plugin at averey update tof
qgisocmmons. Something impossibile with third party plugin, in Boundless
case we had control on deployment and packaging of the product, something
radically different for the standard QGIS.
So I would link the package version to QGIS version avoiding a different
relase math and versioning.
I also agree to avoid ti add snippets that can be solved usign core API.
Btw, for the case of NetworkAccessManager it was introduced to allow
upgrade comnon plugins using QgsNetowkrAccessManager or requests to use the
integrated auth system, something hard to describe into a docstring... btw
I documented it in the PyQGIS coockbook in the auth system paragraphs.
cheers
Luigi Pirelli
**************************************************************************************************
* LinkedIn: https://www.linkedin.com/in/luigipirelli
* Stackexchange: http://gis.stackexchange.com/users/19667/luigi-pirelli
* GitHub: https://github.com/luipir
* Mastering QGIS 2nd Edition:
*
https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition
* Hire me: http://goo.gl/BYRQKg
**************************************************************************************************
On 6 April 2018 at 01:55, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> On 5 April 2018 at 05:06, Richard Duivenvoorde <rdmailings at duif.net>
> wrote:
>
> > So my main point:
> > - how to give everybody the possibilty to implement a locator class, BUT
> > also share a common base class or use the same QgsNetworkAccessManager
> > moduel?
> >
> > Some options:
> > - we create a separate repo for 'common' python classes, and via git
> > submodules everybody pulls in it's own copy of those classes
> > - we create a common-qgis-python module which would ship with QGIS (with
> > filterbaseclass, QgsNetworkAccessManager, and other ideas from the
> > Boundless commons lib).
>
> My concern with the second approach is (and always has been) that
> these common modules effectively become part of the stable API. We'd
> need to carefully decide on things like:
>
> - how are releases of the module handled? Is it bound to QGIS
> releases, or on its own release schedule?
> - Would the module be versioned (i.e. if it's not tied into QGIS
> releases and packaged accordingly, will the code need to work with any
> QGIS version from 3.0 up?)
>
> We'd also need to very carefully vet all contributions to this module,
> to ensure that they aren't reproducing functionality which is already
> present in the core/gui modules. A lot of the code in common python
> modules I've seen is just re-implementations of widgets and classes
> which are already present in the master codebase, and which should
> always be used instead. If Python syntactical sugar is desired for
> these existing c++ classes then I'd much prefer to see it implemented
> in the core QGIS module, such as is done here:
>
> - https://github.com/qgis/QGIS/blob/master/python/core/__init__.py#L192
> - https://github.com/qgis/QGIS/blob/master/src/core/
> qgsreadwritecontext.h#L84
> (Via https://github.com/qgis/QGIS/blob/master/python/core/__init__.py#L216
> and
> - https://github.com/qgis/QGIS/blob/master/src/core/qgsproject.h#L1316
> (via https://github.com/qgis/QGIS/blob/master/python/core/__init__.py#L240
> )
>
> This is a nice approach to adding standard Python coding patterns into
> the QGIS API, with the benefit that it's already tied into the QGIS
> releases, packaged accordingly, and are all unit tested on Travis.
> Maybe the same approach should be taken for adding the network access
> manager.
>
> Just my 2c!
>
> > PS, wannatry? Download
> > https://github.com/rduivenvoorde/qgislocator/raw/
> master/qgislocator_0.1.1.zip
> > and use Install from ZIP in the plugin manager. Use '2022zj' to search
> > PDOK, or 'eiffel' to search Google. Note that you may need a google key
> > to use their geocoder.
>
> Yep, can't wait to give this a spin :)
>
> Nyall
>
> >
> >
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180406/b41139e1/attachment-0001.html>
More information about the QGIS-Developer
mailing list