From c1e003ff2f8a43189d48b7194ec8556aa3d88641 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 4 Nov 2018 09:45:41 +0100 Subject: [PATCH] Python: reduce amount of warnings when building with `buildPython*` By default all warnings were printed. This occasionally resulted in a lot of warnings leading to builds being killed. This commit reduces the amount of warnings printed. --- pkgs/development/interpreters/python/mk-python-derivation.nix | 4 ++++ pkgs/development/python-modules/pytest/default.nix | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 63ffdbb8c0a..ef8ee4e5425 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -101,6 +101,10 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [ ${python.interpreter} ${./catch_conflicts}/catch_conflicts.py '' + attrs.postFixup or ''''; + # Print fewer warnings so we have less noise in our logs + # The amount of warnings also caused builds to be terminated. + PYTHONWARNINGS="once"; + meta = { # default to python's platforms platforms = python.meta.platforms; diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index 9412a750a9a..ad8c8d9ad0d 100644 --- a/pkgs/development/python-modules/pytest/default.nix +++ b/pkgs/development/python-modules/pytest/default.nix @@ -24,7 +24,8 @@ buildPythonPackage rec { checkPhase = '' runHook preCheck - $out/bin/py.test -x testing/ + # Re-enable warnings because the test suite relies on it. + PYTHONWARNINGS= $out/bin/py.test -x testing/ runHook postCheck '';