diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2021-06-23 07:59:27 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2021-06-24 08:56:50 +0300 |
commit | 8d0fa80a36270cbe53ebdb98741124b122681bf3 (patch) | |
tree | fecdec56f9e22d6fdf73ebc168b139dd10633a9b /conanfile.py | |
parent | 4746527aad9bb2767182b35bc6136b0c410252c4 (diff) | |
download | qtsvg-8d0fa80a36270cbe53ebdb98741124b122681bf3.tar.gz |
Conan: Split version string interpolation into separate function
Make the readibility and syntax highlighting a bit cleaner.
Pick-to: 6.2
Change-Id: I8d35de9c9aac320a6c7216018697c6e84327f7b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'conanfile.py')
-rw-r--r-- | conanfile.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/conanfile.py b/conanfile.py index b733d3b..6871403 100644 --- a/conanfile.py +++ b/conanfile.py @@ -40,6 +40,10 @@ def _parse_qt_version_by_key(key: str) -> str: return ret.pop() if ret else "" +def _get_qt_minor_version() -> str: + return _parse_qt_version_by_key('QT_REPO_MODULE_VERSION')[0:3] + + class QtSvg(ConanFile): name = "qtsvg" license = "LGPL-3.0-only, Commercial Qt License Agreement" @@ -56,7 +60,7 @@ class QtSvg(ConanFile): exports_sources = "*", "!conan*.*" # use commit ID as the RREV (recipe revision) if this is exported from .git repository revision_mode = "scm" if Path(Path(__file__).parent.resolve() / ".git").exists() else "hash" - python_requires = f"qt-conan-common/{_parse_qt_version_by_key('QT_REPO_MODULE_VERSION')[0:3]}@qt/everywhere" + python_requires = f"qt-conan-common/{_get_qt_minor_version()}@qt/everywhere" def set_version(self): _ver = _parse_qt_version_by_key("QT_REPO_MODULE_VERSION") |