Skip to content

Commit 562c381

Browse files
committed
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 errors with the exception of the installation of the driver itself. We want to catch if the installation of our own packages causes warning (e.g., `DepercationWarning`s).
1 parent 141d5a0 commit 562c381

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

testkit/_common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ def run(args, env=None):
1313
)
1414

1515

16-
def run_python(args, env=None):
17-
run([TEST_BACKEND_VERSION, "-u", "-W", "error", *args], env=env)
16+
def run_python(args, env=None, warning_as_error=True):
17+
cmd = [TEST_BACKEND_VERSION, "-u"]
18+
if warning_as_error:
19+
cmd += ["-W", "error"]
20+
cmd += list(args)
21+
run(cmd, env=env)

testkit/build.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828

2929

3030
if __name__ == "__main__":
31-
run_python(["-m", "pip", "install", "-U", "pip"])
32-
run_python(["-m", "pip", "install", "--use-pep517", "-Ur",
33-
"requirements-dev.txt"])
31+
run_python(["-m", "pip", "install", "-U", "pip"],
32+
warning_as_error=False)
33+
run_python(["-m", "pip", "install", "-Ur", "requirements-dev.txt"],
34+
warning_as_error=False)
35+
36+
# uninstall the driver and re-install it with warnings as errors to make
37+
# sure that we don't cause any warnings
38+
run_python(["-m", "pip", "uninstall", "-y", "neo4j"],
39+
warning_as_error=False)
40+
run_python(["-m", "pip", "install", "-U", "-e", "."])

0 commit comments

Comments
 (0)