Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-07-02 Thread Tom Chadwin
After lots of help and contributions from Akbar, I think this is now working.
If anyone else would find the information useful, see:

https://github.com/tomchadwin/qgis2web/issues/72

and

https://github.com/tomchadwin/qgis2web/tree/LayerTree-API

Many thanks, Akbar and everyone who has helped out on this

Tom



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213954.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-29 Thread Tom Chadwin
Any instance of qgis_get_app() outside of /test is only my attempts to get
his testing working, so I'll dig out the commit which put it there and
revert it. I'll have a look at your guidance on implementing iface, but if
you are able and interested to have a look as well, then of course I'd be
extremely grateful, whether this weekend or later.

Thanks again for all the help



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213440.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-29 Thread Akbar Gumbira
I just looked at the code base. If you are patient enough to get that
sorted out, I can look at that around the weekend and make a PR. One of the
problem is I see that you are playing around with get_qgis_app in the main
code (MainDialog). That function is only intended for testing purpose.

On Tue, Jun 30, 2015 at 12:02 AM, Akbar Gumbira 
wrote:

> You can also use iface object provided by Python wrapper from qgis.utils.
> So in get_qgis_app instead of having the mock QgisInterface, you can do
> something like:
>
> ```
> from qgis.utils import iface
> IFACE = iface
> ```
>
> I think in InaSAFE, we don't want unnecessary implementations from the
> iface from qgis.utils. I am not aware of the first history of it though.
>
> Regards
>
> On Sat, Jun 27, 2015 at 5:44 AM, Tom Chadwin 
> wrote:
>
>> I suspect I'm not going to get this to work. I hit the problem that my
>> plugin
>> 's code used iface, which was not recognised. I managed to inject the
>> dummy
>> iface replacement created in the qgis_get_app () function mentioned above.
>> However, next the code calls:
>>
>> ```python
>> IFACE.legendInterface().groupLayerRelationship()
>>
>> ```
>>
>> While the dummy iface implements a method legendInterface(), it's just a
>> stub. It doesn't even return the right object type, but returns a canvas
>> object instead.
>>
>> I might be able to expand the dummy iface to add in the extra features
>> required to get the right object type returned by that method, but isn't
>> this all pointless?
>>
>> - the more dummy object I have to build, the less real object I am testing
>>
>> - the dummy won't have the session data associated with it, such as the
>> project's layers
>>
>> An I misunderstanding something, or is my attempt to set up testing for
>> qgis2web doomed?
>>
>>
>>
>> --
>> View this message in context:
>> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html
>> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
>> ___
>> Qgis-developer mailing list
>> Qgis-developer@lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
>
> *---*
>
> *Akbar Gumbira*
> *Software Engineer*
> *Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-29 Thread Akbar Gumbira
You can also use iface object provided by Python wrapper from qgis.utils.
So in get_qgis_app instead of having the mock QgisInterface, you can do
something like:

```
from qgis.utils import iface
IFACE = iface
```

I think in InaSAFE, we don't want unnecessary implementations from the
iface from qgis.utils. I am not aware of the first history of it though.

Regards

On Sat, Jun 27, 2015 at 5:44 AM, Tom Chadwin 
wrote:

> I suspect I'm not going to get this to work. I hit the problem that my
> plugin
> 's code used iface, which was not recognised. I managed to inject the dummy
> iface replacement created in the qgis_get_app () function mentioned above.
> However, next the code calls:
>
> ```python
> IFACE.legendInterface().groupLayerRelationship()
>
> ```
>
> While the dummy iface implements a method legendInterface(), it's just a
> stub. It doesn't even return the right object type, but returns a canvas
> object instead.
>
> I might be able to expand the dummy iface to add in the extra features
> required to get the right object type returned by that method, but isn't
> this all pointless?
>
> - the more dummy object I have to build, the less real object I am testing
>
> - the dummy won't have the session data associated with it, such as the
> project's layers
>
> An I misunderstanding something, or is my attempt to set up testing for
> qgis2web doomed?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-26 Thread Tom Chadwin
I suspect I'm not going to get this to work. I hit the problem that my plugin
's code used iface, which was not recognised. I managed to inject the dummy
iface replacement created in the qgis_get_app () function mentioned above.
However, next the code calls:

```python
IFACE.legendInterface().groupLayerRelationship()

```

While the dummy iface implements a method legendInterface(), it's just a
stub. It doesn't even return the right object type, but returns a canvas
object instead. 

I might be able to expand the dummy iface to add in the extra features
required to get the right object type returned by that method, but isn't
this all pointless? 

- the more dummy object I have to build, the less real object I am testing

- the dummy won't have the session data associated with it, such as the
project's layers

An I misunderstanding something, or is my attempt to set up testing for
qgis2web doomed? 



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5213199.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-24 Thread Tom Chadwin
I already had a similar get_qgis_app() function, but I was only using it to
instantiate QgsApplication in tests which I thought had QIcon or QPixmap
functionality. Adding it to all other tests has solved the problem. Thanks
so much for your patience.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212771.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-24 Thread Akbar Gumbira
I don't know the code base you're working on. I think what you need to do
is to narrow down which test that produces that error. You can split the
tests like binary search or whatever method you like (running the tests for
each package etc). In InaSAFE, for testing purposes, there's a handy
function called get_qgis_app that will instantiate a QgsApp. It is used in
the tests which also to prevent that error. See here for the usage of that
function
https://github.com/AIFDR/inasafe/search?utf8=%E2%9C%93&q=get_qgis_app

Regards

On Wed, Jun 24, 2015 at 5:01 PM, Tom Chadwin 
wrote:

> So Google has told me repeatedly. My issues are:
>
> - I have not previously done this because the plugin works fine in QGIS,
> and
> this issue has only shown up in tests
>
> - I don't know how (or where) to instantiate QApplication (or
> QgsApplication?)
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212636.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-24 Thread Tom Chadwin
So Google has told me repeatedly. My issues are:

- I have not previously done this because the plugin works fine in QGIS, and
this issue has only shown up in tests

- I don't know how (or where) to instantiate QApplication (or
QgsApplication?)



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212636.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-24 Thread Akbar Gumbira
The message says it all. You must instantiate QApplication before
instantiating QPaintDevice object or any object from classes inherited from
QPaintDevice.

Regards

On Wed, Jun 24, 2015 at 4:06 PM, Tom Chadwin 
wrote:

> I've got the build environment up now, I think - many thanks, all. However,
> does anyone know how I can get rid of the following test fail:
>
> QPixmap: Must construct a QApplication before a QPaintDevice
>
> I don't see QApplication instantiated anywhere. I'm not sure how to get
> past
> this, since the fail is early on, so I don't get to the important tests for
> the plugin.
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212624.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-24 Thread Tom Chadwin
I've got the build environment up now, I think - many thanks, all. However,
does anyone know how I can get rid of the following test fail:

QPixmap: Must construct a QApplication before a QPaintDevice

I don't see QApplication instantiated anywhere. I'm not sure how to get past
this, since the fail is early on, so I don't get to the important tests for
the plugin.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212624.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-22 Thread Akbar Gumbira
By default in QGIS plugin builder you meant is here
https://github.com/g-sherman/Qgis-Plugin-Builder/blob/master/run-env-linux.sh#L6
?. If so, that is not the default if you install QGIS like this in Travis
https://github.com/AIFDR/inasafe/blob/develop/.travis.yml#L17. You can just
pass /usr as the argument when running run-env-linux.sh script

On Tue, Jun 23, 2015 at 1:19 AM, Tom Chadwin 
wrote:

> I've got a bit further with this, but have an embarrassingly basic
> question.
> I'm using Tim's Plugin Builder's run-env-linux.sh, but the default QGIS
> path
> doesn't seem to match where Travis installs QGIS to - is Travis running
> Ubuntu? Can anyone tell me what QGIS path I should pass to
> run-env-linux.sh?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212347.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-22 Thread Tom Chadwin
I have. I was just trying to put together as minimal a test environment as 
possible. I didn't know which packages from the inasafe yaml I needed, and 
which I could do without. I presume it requires many more than qgis2web.

 Original message 
From: "Etienne Trimaille [via OSGeo.org]" 

Date: 22/06/2015 19:37 (GMT+00:00)
To: Tom Chadwin 
Subject: Re: Using TravisCI integration in Github for QGIS Python plugin

Have a look to the Travis config file in inasafe :
https://github.com/AIFDR/inasafe/blob/develop/.travis.yml

2015-06-22 20:19 GMT+02:00 Tom Chadwin <[hidden email]>:
I've got a bit further with this, but have an embarrassingly basic question.
I'm using Tim's Plugin Builder's run-env-linux.sh, but the default QGIS path
doesn't seem to match where Travis installs QGIS to - is Travis running
Ubuntu? Can anyone tell me what QGIS path I should pass to run-env-linux.sh?



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212347.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer


___
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer


If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212350.html
To unsubscribe from Using TravisCI integration in Github for QGIS Python 
plugin, click 
here.
NAML


Tom Chadwin, ICT Manager
Telephone: 01434 611530 Mob:
Web: 
www.northumberlandnationalpark.org.uk

IMPORTANT NOTICE - Disclaimer - This communication is from Northumberland 
National Park Authority (NNPA).The Authority’s head office and principal place 
of business is Eastburn, South Park, Hexham, Northumberland, NE46 1BS, United 
Kingdom. If you are not the intended recipient(s) please note that any form of 
disclosure, distribution, copying or use of this communication or the 
information in it or in any attachments is strictly prohibited and may be 
unlawful. If you have received this communication in error, please delete the 
email and destroy any copies of it. Any views or opinions presented are solely 
those of the author and do not necessarily represent those of NNPA.Contractors 
or potential contractors are reminded that a formal Order or Contract is needed 
for NNPA to be bound by any offer or acceptance of terms for the supply of 
goods or services Although this email and any attachments are believed to be 
free of any virus or other defects which might affect any computer or IT system 
into which they are received, no responsibility is accepted by the NNPA for any 
loss or damage arising in any way from the receipt or use thereof. Computer 
systems of this Authority may be monitored and communications carried out on 
them recorded, to secure the effective operation of the system and for other 
lawful purpose.




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212359.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-22 Thread Etienne Trimaille
Have a look to the Travis config file in inasafe :
https://github.com/AIFDR/inasafe/blob/develop/.travis.yml

2015-06-22 20:19 GMT+02:00 Tom Chadwin :

> I've got a bit further with this, but have an embarrassingly basic
> question.
> I'm using Tim's Plugin Builder's run-env-linux.sh, but the default QGIS
> path
> doesn't seem to match where Travis installs QGIS to - is Travis running
> Ubuntu? Can anyone tell me what QGIS path I should pass to
> run-env-linux.sh?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212347.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-06-22 Thread Tom Chadwin
I've got a bit further with this, but have an embarrassingly basic question.
I'm using Tim's Plugin Builder's run-env-linux.sh, but the default QGIS path
doesn't seem to match where Travis installs QGIS to - is Travis running
Ubuntu? Can anyone tell me what QGIS path I should pass to run-env-linux.sh?



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5212347.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-05-28 Thread Akbar Gumbira
In InaSAFE we actually use Jenkins with Github PR Builder plugin now for
our reference. We had some problems with Travis: There were some tests that
could take more than 10 mins and all the tests could take > 50 mins and
would hit job timeout in travis for public repo. Also sometimes the job
failed to start.

But thanks for mentioning InaSAFE, I think now I can make Travis work again
as we reworked some tests to just use dummy data and it only takes around
24mins now that I see its Travis page.

Regards

On Wed, May 27, 2015 at 3:32 PM, Tom Chadwin 
wrote:

> Thanks very much, Martin. Looks like I have a lot to learn (unittest/nose,
> as
> well as Travis itself).
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5207727.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*---*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-05-27 Thread Tom Chadwin
Thanks very much, Martin. Looks like I have a lot to learn (unittest/nose, as
well as Travis itself).



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646p5207727.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-05-26 Thread Martin Dobias
Hi Tom

For example InaSAFE uses Travis CI - the Travis config file from there may
be a good start:
https://github.com/AIFDR/inasafe

We use Travis CI for Crayfish plugin - though we test only crayfish
library, not the plugin itself, so QGIS libs are not required:
https://github.com/lutraconsulting/qgis-crayfish-plugin

There will be most likely various other plugins using it too...

Regards
Martin



On Tue, May 26, 2015 at 11:31 PM, Tom Chadwin 
wrote:

> Has anyone set up TravisCI to test commits in a QGIS Python plugin Github
> repo? Can anyone give me some help?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Using TravisCI integration in Github for QGIS Python plugin

2015-05-26 Thread Tom Chadwin
Has anyone set up TravisCI to test commits in a QGIS Python plugin Github
repo? Can anyone give me some help?



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Using-TravisCI-integration-in-Github-for-QGIS-Python-plugin-tp5207646.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer