qgis_deployment_toolbelt.jobs.job_qgis_installation_finder module¶
Tools to find installed QGIS version
Author: Jean-Marie KERLOCH (https://github.com/jmkerloch)
- class qgis_deployment_toolbelt.jobs.job_qgis_installation_finder.JobQgisInstallationFinder(options: dict | None)¶
Bases:
GenericJobClass to find installed QGIS binaries and version(s).
- OPTIONS¶
alias of
QgisInstallationFinderOptions
- __init__(options: dict | None) None¶
Instantiate the class.
- Parameters:
options (dict | None) – options set in the
withkey of the scenario step, see QgisInstallationFinderOptions
- _abc_impl = <_abc._abc_data object>¶
- _export_qgis_version(version_str: str) None¶
Export the detected QGIS version as an environment variable.
- Parameters:
version_str (str) – QGIS version, typically a SemVer string like 3.40.1.
- static _get_latest_matching_version_path(found_versions: dict[str, str], version: str) str | None¶
Get latest version path matching a wanted version.
- static _get_latest_version_from_list(versions: list[str]) str | None¶
Get latest version from a list.
- _get_linux_installed_qgis_path() dict[str, str]¶
Get install qgis path for linux operating system with which
- static _get_qgis_bin_version(qgis_bin: str) str | None¶
Get QGIS bin version with –version.
See:
- static _get_qgis_found_version_dict_from_search_paths(search_paths: list[str], search_patterns: list[str]) dict[str, str]¶
Define qgis found version dict from a list of search path.
If identical version are found in multiple path, the first version found in search_path is used.
- static _get_qgis_versions_in_dir(search_dir: str, search_patterns: list[str], found_version: dict[str, str]) None¶
Get QGIS binary path from an install directory.
- _get_search_paths_with_environment_variable() list[str]¶
Get search_paths option with environment variable update.
- static _get_windows_hide_console_startupinfo() dict¶
Build extra kwargs to hide a console window newly created on Windows.
- Returns:
- empty on non-Windows platforms, otherwise a single
startupinfoentry ready to unpack intosubprocess.run.
- Return type:
- _get_windows_installed_qgis_path() dict[str, str]¶
Get dict of installed QGIS version in common install directory.
- static _search_qgis_version_and_add_to_dict(qgis_bin: str, found_version: dict[str, str]) None¶
Search qgis version from qgis binary and add to found_version dict if found
- static _version_sort_key(version_str: str) Version¶
Transforn a version string into a sortable and comparable Version object.
- Parameters:
version_str (str) – version string to parse, typically X.Y.Z.
- Returns:
parsed version, or Version(“0”) if parsing failed.
- Return type:
Version
- get_installed_qgis_path() str | None¶
Get the path to the installed QGIS executable best matching job options.
- Returns:
installed qgis path
- Return type:
str | None
- get_installed_qgis_version_and_path() tuple[str, str] | None¶
Get the installed QGIS version and executable path best matching job options.
- class qgis_deployment_toolbelt.jobs.job_qgis_installation_finder.QgisInstallationFinderOptions(*, if_not_found: Literal['warning', 'error'] = 'warning', version_priority: list[str] = [], search_paths: list[str] = [])¶
Bases:
JobOptionsOptions of the qgis-installation-finder job.
- _abc_impl = <_abc._abc_data object>¶
- model_config = {'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].