With QGIS 3.22 the GRASS algorithms got its own provider (grassprovider.Grass7AlgorithmProvider
) and are no more part of processing.algs
. Knowing this, in a standalone pyqgis-script I am trying to add the GRASS algs to the processingRegistry
with QgsApplication.processingRegistry().addProvider(Grass7AlgorithmProvider())
.
If I am now trying to run a GRASS alg, e.g. processing.run("grass7:v.dissolve", ...)
I get
_core.QgsProcessingException: Error: Algorithm grass7:v.dissolve not found
When I then list all the registered algs
for alg in QgsApplication.processingRegistry().algorithms():
print("{}:{} --> {}".format(alg.provider().name(), alg.name(), alg.displayName()))
I get (after the entries of GDAL algs) a list of blank entries:
: -->
: -->
: -->
: -->
...
Obviously the GRASS algs are registered, but with no provider name and with no alg name resulting that I can't call the algs.
Is there anything I am doing wrong or I s it a bug?