summaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2021-06-23 07:59:27 +0300
committerIikka Eklund <iikka.eklund@qt.io>2021-06-24 08:56:50 +0300
commit8d0fa80a36270cbe53ebdb98741124b122681bf3 (patch)
treefecdec56f9e22d6fdf73ebc168b139dd10633a9b /conanfile.py
parent4746527aad9bb2767182b35bc6136b0c410252c4 (diff)
downloadqtsvg-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.py6
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")