aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/wheel_utils.py
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-12-29 18:22:54 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-04 17:03:46 +0000
commit98919e94556eb96a7a0afb5e160c7634c4fbf4ef (patch)
tree3411e9d2ebe38cbcf87cfe89ba82d931e86bfc0d /build_scripts/wheel_utils.py
parent3f1abffcbc1149ad8876ad0ef842968963a8015b (diff)
build_scripts: use f-strings instead of format()
Change-Id: I165e9a39f968f67f9eae3a632739908d5f8fda59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 6cc55fefc8ddf12ecc9dcce33e367148e6216b1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'build_scripts/wheel_utils.py')
-rw-r--r--build_scripts/wheel_utils.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/build_scripts/wheel_utils.py b/build_scripts/wheel_utils.py
index d1d349120..a976e2bce 100644
--- a/build_scripts/wheel_utils.py
+++ b/build_scripts/wheel_utils.py
@@ -65,12 +65,12 @@ def get_qt_version():
qt_version = qtinfo.version
if not qt_version:
- m = "Failed to query the Qt version with qmake {0}".format(qtinfo.qmake_command)
- raise DistutilsSetupError(m)
+ raise DistutilsSetupError("Failed to query the Qt version with "
+ f"qmake {qtinfo.qmake_command}")
if LooseVersion(qtinfo.version) < LooseVersion("5.7"):
- m = "Incompatible Qt version detected: {}. A Qt version >= 5.7 is required.".format(qt_version)
- raise DistutilsSetupError(m)
+ raise DistutilsSetupError(f"Incompatible Qt version detected: {qt_version}. "
+ "A Qt version >= 5.7 is required.")
return qt_version
@@ -82,20 +82,19 @@ def get_package_version():
pyside_version_py = os.path.join(
setup_script_dir, "sources", PYSIDE, "pyside_version.py")
d = get_python_dict(pyside_version_py)
-
- final_version = "{}.{}.{}".format(
- d['major_version'], d['minor_version'], d['patch_version'])
+ final_version = f"{d['major_version']}.{d['minor_version']}.{d['patch_version']}"
release_version_type = d['release_version_type']
pre_release_version = d['pre_release_version']
if pre_release_version and release_version_type:
- final_version += release_version_type + pre_release_version
+ final_version = f"{final_version}{release_version_type}{pre_release_version}"
+
if release_version_type.startswith("comm"):
- final_version += "." + release_version_type
+ final_version = f"{final_version}.{release_version_type}"
# Add the current timestamp to the version number, to suggest it
# is a development snapshot build.
if OPTION["SNAPSHOT_BUILD"]:
- final_version += ".dev{}".format(get_package_timestamp())
+ final_version = f"{final_version}.dev{get_package_timestamp()}"
return final_version
@@ -157,5 +156,5 @@ def macos_plat_name():
deployment_target = macos_pyside_min_deployment_target()
# Example triple "macosx-10.12-x86_64".
plat = get_platform().split("-")
- plat_name = "{}-{}-{}".format(plat[0], deployment_target, plat[2])
+ plat_name = f"{plat[0]}-{deployment_target}-{plat[2]}"
return plat_name