The private _get_module_version function was initially added 4 years ago in PR #466. At that time, we supported Python 3.6-3.8 and importlib.metadata was not available yet.
importlib.metadata was added in Python 3.8. With this module, getting package version can be greatly simplified.
This PR simplifies the _get_module_version function and also add two more tests related to Ghostscript to increase code coverage by 0.16% (now we reach 98.49%).
The private
_get_module_version
function was initially added 4 years ago in PR #466. At that time, we supported Python 3.6-3.8 andimportlib.metadata
was not available yet.importlib.metadata
was added in Python 3.8. With this module, getting package version can be greatly simplified.This PR simplifies the
_get_module_version
function and also add two more tests related to Ghostscript to increase code coverage by 0.16% (now we reach 98.49%).Without optional packages:
With optional packages: