Skip to content

Commit

Permalink
Add python_version to json output from qgis_process tool
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 22, 2021
1 parent 45a9309 commit ff9cb19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/process/qgsprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,7 @@ void QgsProcessingExec::addVersionInformation( QVariantMap &json )
json.insert( QStringLiteral( "qgis_code_revision" ), Qgis::devVersion() );
}
json.insert( QStringLiteral( "qt_version" ), qVersion() );
json.insert( QStringLiteral( "python_version" ), PYTHON_VERSION );
json.insert( QStringLiteral( "gdal_version" ), GDALVersionInfo( "RELEASE_NAME" ) );
json.insert( QStringLiteral( "geos_version" ), GEOSversion() );

Expand Down
6 changes: 6 additions & 0 deletions tests/src/python/test_qgsprocessexecutable.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def testPluginsJson(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)
self.assertIn('plugins', res)
Expand All @@ -102,6 +103,7 @@ def testAlgorithmsListJson(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)

Expand Down Expand Up @@ -135,6 +137,7 @@ def testAlgorithmHelpJson(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)

Expand Down Expand Up @@ -192,6 +195,7 @@ def testAlgorithmRunJson(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)

Expand All @@ -218,6 +222,7 @@ def testAlgorithmRunListValue(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)

Expand Down Expand Up @@ -261,6 +266,7 @@ def testModelRunJson(self):
self.assertIn('gdal_version', res)
self.assertIn('geos_version', res)
self.assertIn('proj_version', res)
self.assertIn('python_version', res)
self.assertIn('qt_version', res)
self.assertIn('qgis_version', res)
self.assertEqual(res['algorithm_details']['id'], 'Test model')
Expand Down

0 comments on commit ff9cb19

Please sign in to comment.