From 538e16cefca265e106cd18ad79b62dfc6925c54e Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Mon, 17 Jul 2023 12:18:32 +0200 Subject: [PATCH] Reduce scope of pip warnings as errors The CI has been failing too often recently because of changes in pip and dependencies. Those failures were mostly irrelevant warning that we turned into errors for better visibility. However, so far there was never any action we needed to take other than muting that warning on or the other way. Therefore, this commit changes it so that all pip installation calls are run without treating warning as error. --- testkit/_common.py | 8 ++++++-- testkit/build.py | 8 +++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/testkit/_common.py b/testkit/_common.py index d4f8da965..1ab0254ed 100644 --- a/testkit/_common.py +++ b/testkit/_common.py @@ -13,5 +13,9 @@ def run(args, env=None): ) -def run_python(args, env=None): - run([TEST_BACKEND_VERSION, "-u", "-W", "error", *args], env=env) +def run_python(args, env=None, warning_as_error=True): + cmd = [TEST_BACKEND_VERSION, "-u"] + if warning_as_error: + cmd += ["-W", "error"] + cmd += list(args) + run(cmd, env=env) diff --git a/testkit/build.py b/testkit/build.py index dd1f318bc..2937f942e 100644 --- a/testkit/build.py +++ b/testkit/build.py @@ -9,6 +9,8 @@ if __name__ == "__main__": run_python(["setup.py", "build"]) - run_python(["-m", "pip", "install", "-U", "pip"]) - run_python(["-m", "pip", "install", "-Ur", - "testkitbackend/requirements.txt"]) + run_python(["-m", "pip", "install", "-U", "pip"], warning_as_error=False) + run_python( + ["-m", "pip", "install", "-Ur", "testkitbackend/requirements.txt"], + warning_as_error=False + )