[QGIS-Developer] Documentation: pyqgis cookbook python code tests

Arnaud Morvan arnaud.morvan at camptocamp.com
Tue Mar 26 01:02:50 PDT 2019


Same is coming for the Python API docstrings: 
https://github.com/qgis/QGIS/pull/9615

Cheers

Arnaud Morvan
Ingénieur logiciel
Tél: +33 (0)4 58 48 20 32

Camptocamp France SAS
18 rue du Lac Saint André
Savoie Technolac - Bâtiment Le Dauphin
F-73370 Le Bourget du Lac
http://www.camptocamp.com

Le 24/03/2019 à 22:44, Tim Sutton a écrit :
> Yeah this is a really great step forward - thanks Arnaud!
>
> Regards
>
> Tim
>
>> On 24 Mar 2019, at 20:52, Luigi Pirelli <luipir at gmail.com 
>> <mailto:luipir at gmail.com>> wrote:
>>
>> impressive... tnx Arnoud
>>
>> 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 Sat, 16 Mar 2019 at 14:02, Richard Duivenvoorde 
>> <rdmailings at duif.net <mailto:rdmailings at duif.net>> wrote:
>>
>>     See also:
>>     https://docs.qgis.org/testing/en/docs/documentation_guidelines/cookbook_guidelines.html
>>
>>     R
>>
>>     On 16/03/2019 11.05, Richard Duivenvoorde wrote:
>>     > Hi,
>>     >
>>     > For those not aware of Arnaud's work during the Hackfest:
>>     >
>>     > His work makes it relatively easy to test the python snippets
>>     in the
>>     > pyqgisbook. In this way keeping the python snippets up to date with
>>     > code/api changes of QGIS itself is much easier.
>>     >
>>     > We use a Sphinx extension:
>>     > https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html
>>     >
>>     > In short:
>>     > - you run the snippets from within the cookbook rst using
>>     QGIS(libs)
>>     > either from your build/install dir, OR from within a
>>     QGIS-Desktop docker
>>     > instance (same as is being used for automatic tests)
>>     > - so we (have to!) adapt the code in the pycookbook a little to
>>     make it
>>     > testable (adding testsetup:: and testcode:: directives)
>>     > - he slightly changed the way you can build the documentation
>>     (on Linux)
>>     > using one or two extra make (.mk) files.
>>     >
>>     > See:
>>     > https://github.com/qgis/qgis-documentation#testing-python-snippets
>>     >
>>     > I've just tested and this 1 test :-) works flawlessly if you
>>     create a
>>     > 'user.mk <http://user.mk/>' pointing to your QGIS_PREFIX_PATH
>>     >
>>     > So: now we can make all code snippets testable!
>>     > If I am correct he was also busy to get the code examples in the
>>     > doxygen/pyqgiscook work with this too @arnaud ?)
>>     >
>>     > Please try!
>>     >
>>     > Regards,
>>     >
>>     > Richard Duivenvoorde
>>     >
>>     > PS this is Sphinx/Python only, but if somebody jumps in to make
>>     it work
>>     > in a Windows way this would be even nicer. Or we should update
>>     the paver
>>     > way again?
>>     > _______________________________________________
>>     > QGIS-Developer mailing list
>>     > QGIS-Developer at lists.osgeo.org
>>     <mailto: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
>>     <mailto: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 <mailto: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
>
>>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:*Kartoza
> *Ex Project chair:*QGIS.org <http://QGIS.org>
>
> Visit http://kartoza.com <http://kartoza.com/> to find out about open 
> source:
>
> Desktop GIS programming services
> Geospatial web development
> GIS Training
> Consulting Services
>
> *Skype*: timlinux
> *IRC:*timlinux on #qgis at freenode.net <http://freenode.net>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190326/26814b83/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KartozaNewLogoThumbnail.jpg
Type: image/jpeg
Size: 6122 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20190326/26814b83/attachment-0001.jpg>


More information about the QGIS-Developer mailing list