Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.Babel: Fix use of glibcLocales, skip musl tests #75676

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 17 additions & 5 deletions 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";
Expand All @@ -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; {
Expand Down