From d237a92e63aafab6d63ebb5f5e2d96b77c3727aa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 7 May 2023 12:23:52 +0200 Subject: [PATCH] update-python-libraries: Fix some issues discovered by ruff and pyright. --- .../update-python-libraries/update-python-libraries.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py index 42ebd89143ee..970da7c5c5a4 100755 --- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py +++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py @@ -65,7 +65,7 @@ def _get_values(attribute, text): :returns: List of matches. """ - regex = '{}\s+=\s+"(.*)";'.format(re.escape(attribute)) + regex = fr'{re.escape(attribute)}\s+=\s+"(.*)";' regex = re.compile(regex) values = regex.findall(text) return values @@ -430,7 +430,7 @@ def _update_package(path, target): if fetcher == 'fetchFromGitHub': # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";` # in which no string value is meant to be substituted. However, we can just overwrite the previous value. - regex = '(rev\s+=\s+[^;]*;)' + regex = r'(rev\s+=\s+[^;]*;)' regex = re.compile(regex) matches = regex.findall(text) n = len(matches) @@ -519,7 +519,7 @@ environment variables: if len(packages) > 1: global BULK_UPDATE - BULK_UPDATE = true + BULK_UPDATE = True logging.info("Updating packages...")