aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-02-26 15:51:53 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-03-02 20:34:37 +0000
commit0c51c4dd78c564eaf722a2735ef1f8236ce00a86 (patch)
treea12dbeb211f965226ad5b1c19019bc31f115642c /utils.py
parentb83eb9e389b0b9501c18dcc123d1957bd7246815 (diff)
Improve macOS minimum deployment target decision process
Instead of asking the user to specify a minimum macOS deployment target, setup.py will now query the value from qmake. A user can still specify a custom value if they wish to do so. This simplifies building on the CI, meaning there is no need to hardcode the minimum deployment targets per branch. Task-number: PYSIDE-603 Task-number: PYSIDE-606 Change-Id: I55c79dc643b5a2b59d0e65add132c581fb6fc7f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 6c3b90fb2..169e1218b 100644
--- a/utils.py
+++ b/utils.py
@@ -874,3 +874,17 @@ def rpathsHasOrigin(rpaths):
if match:
return True
return False
+
+def memoize(function):
+ """ Decorator to wrap a function with a memoizing callable.
+ It returns cached values when the wrapped function is called with the same arguments.
+ """
+ memo = {}
+ def wrapper(*args):
+ if args in memo:
+ return memo[args]
+ else:
+ rv = function(*args)
+ memo[args] = rv
+ return rv
+ return wrapper