diff --git a/pkgs/development/python-modules/Babel/default.nix b/pkgs/development/python-modules/Babel/default.nix index 97b3525782098c..683c94b5ed1ceb 100644 --- a/pkgs/development/python-modules/Babel/default.nix +++ b/pkgs/development/python-modules/Babel/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, pytz, pytest, freezegun, glibcLocales }: +{ stdenv, lib, buildPythonPackage, fetchPypi, pytz, pytest, freezegun, isPy3k, glibcLocales }: buildPythonPackage rec { pname = "Babel"; @@ -11,12 +11,24 @@ buildPythonPackage rec { propagatedBuildInputs = [ pytz ]; - checkInputs = [ pytest freezegun glibcLocales ]; + checkInputs = [ pytest freezegun ] + # Without this, tests fail with a unicode error on Python < 3 + # (checked with 2.7) if glibc is used, see: + # https://github.com/NixOS/nixpkgs/issues/74904 + ++ lib.optionals (!isPy3k && stdenv.hostPlatform.libc == "glibc") [ glibcLocales ]; - doCheck = !stdenv.isDarwin; + doCheck = !stdenv.isDarwin + # Test failure on musl when Python < 3 (checked with 2.7) is used: + # https://github.com/NixOS/nixpkgs/issues/74904 (like above). + && !(stdenv.hostPlatform.isMusl && !isPy3k); - preCheck = '' - export LC_ALL="en_US.UTF-8" + # Without this, the build oddly fails on ofborg CI (but not on nh2's NixOS) + # when Python M 3 is used. + # Even more oddly, using `export LC_ALL="C.UTF-8"` (with quotes) makes it + # fail as well. + # See https://github.com/NixOS/nixpkgs/pull/75676#issuecomment-567289105 + preCheck = if isPy3k then null else '' + export LC_ALL=C.UTF-8 ''; meta = with lib; {