Re: [QGIS-Developer] Is there a recommended way to include external Python packages

2022-07-21 Thread Gerald Kogler via QGIS-Developer
Thanks for your recommendations, with that in mind I'll go for the 
option 2, shipping the 3rd party package with the plugin.


Till now I did that including the whl-file, but after looking at your 
plugins I see the advantage of your code of adding the directory which 
contains the library to sys.path and then doing an import (see 
https://github.com/NationalSecurityAgency/qgis-datetimetools-plugin/blob/master/__init__.py) 




On 21/7/22 19:33, C Hamilton wrote:
Generally speaking it is not recommended, but I have done it with 
several of my plugins (KML Tools, Date/Time Tools). If your python 
package is OS dependent (not pure python) then you don't want to include 
it with your plugin. My Density Analysis plugin can use the optional H3 
library (which I think might be worthwhile for QGIS to include as a part 
of its libraries), but it is machine dependent so I did not include it. 
It is not ideal to have users pip install the library, but you have to 
weigh the costs vs. the benefits of using some library.


Good luck!

On Thu, Jul 21, 2022 at 1:19 PM Gerald Kogler via QGIS-Developer 
mailto:qgis-developer@lists.osgeo.org>> 
wrote:


I'm actually developing a QGIS plugin which depends on pysftp
package to
upload files to a server. For now I thought on asking users to install
it manually, but it would be great to automatize the installation
process.

So the options I see would be:
1. Install external package using pip from inside the plugin.
2. Include and ship external package with the plugin.
3. Ask user to install it manually using pip install.

Is there a recommended way to handle this situation?
___
QGIS-Developer mailing list
QGIS-Developer@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@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [QGIS-Developer] Is there a recommended way to include external Python packages

2022-07-21 Thread C Hamilton via QGIS-Developer
Generally speaking it is not recommended, but I have done it with several
of my plugins (KML Tools, Date/Time Tools). If your python package is OS
dependent (not pure python) then you don't want to include it with your
plugin. My Density Analysis plugin can use the optional H3 library (which I
think might be worthwhile for QGIS to include as a part of its libraries),
but it is machine dependent so I did not include it. It is not ideal to
have users pip install the library, but you have to weigh the costs vs. the
benefits of using some library.

Good luck!

On Thu, Jul 21, 2022 at 1:19 PM Gerald Kogler via QGIS-Developer <
qgis-developer@lists.osgeo.org> wrote:

> I'm actually developing a QGIS plugin which depends on pysftp package to
> upload files to a server. For now I thought on asking users to install
> it manually, but it would be great to automatize the installation process.
>
> So the options I see would be:
> 1. Install external package using pip from inside the plugin.
> 2. Include and ship external package with the plugin.
> 3. Ask user to install it manually using pip install.
>
> Is there a recommended way to handle this situation?
> ___
> QGIS-Developer mailing list
> QGIS-Developer@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@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] Is there a recommended way to include external Python packages

2022-07-21 Thread Gerald Kogler via QGIS-Developer
I'm actually developing a QGIS plugin which depends on pysftp package to 
upload files to a server. For now I thought on asking users to install 
it manually, but it would be great to automatize the installation process.


So the options I see would be:
1. Install external package using pip from inside the plugin.
2. Include and ship external package with the plugin.
3. Ask user to install it manually using pip install.

Is there a recommended way to handle this situation?
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


[QGIS-Developer] Digitize shapes in advanced digitizing toolbar concerns/suggestions

2022-07-21 Thread Alexandre Neto via QGIS-Developer
Hi,

I came across the "recent" change that integrates the options to select to
digitize with segments, curves, shapes, or streaming into a combobox
button. I love it. It makes sense. Thanks, Denis for it.

Nevertheless, the shapes option is dependent on another toolbar (Shape
Digitizing Toolbar), which had led to some bugs [0] but also to some
frustration to some users, not understanding why a strange message appear
when they just want to draw a polygon.

I opened a PR to change the wording of the message that informs the user
that if he decided to digitize using shapes, then he also needs to select
the shape he wants to use [1], but he might not even remember that the last
time he used it, he selected to digitize using shapes.

My suggestions:

1. On QGIS reload, always rollback to "digitize with segment" as default
2. On selecting shapes, automatically enable the Shape Digitizing Toolbar
3. On selecting shapes, automatically enable one of the options in the
shape digiting toolbar, to solve [0], even if the user never used it before.

I can open a feature request if more people agree.

Best regards,

Alexandre Neto
[0] - https://github.com/qgis/QGIS/issues/47648
[1] - https://github.com/qgis/QGIS/pull/49425
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer