From 4f1a9a3c082660cbdd283dc1049a07c30d194e39 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 | 7 ++++--- 2 files changed, 10 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 50b2fff8a..3ac90a2f3 100644 --- a/testkit/build.py +++ b/testkit/build.py @@ -28,6 +28,7 @@ if __name__ == "__main__": - run_python(["-m", "pip", "install", "-U", "pip"]) - run_python(["-m", "pip", "install", "--use-pep517", "-Ur", - "requirements-dev.txt"]) + run_python(["-m", "pip", "install", "-U", "pip"], + warning_as_error=False) + run_python(["-m", "pip", "install", "-Ur", "requirements-dev.txt"], + warning_as_error=False)