From 0c51c4dd78c564eaf722a2735ef1f8236ce00a86 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 26 Feb 2018 15:51:53 +0100 Subject: 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 --- utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'utils.py') 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 -- cgit v1.2.3