From 712b402565e53a0e00113e9b617d4edd428d158c Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 22 Nov 2021 23:24:50 +0000 Subject: [PATCH] python3Packages.cwcwidth: fix tests on darwin use the same locale settings used by upstream's CI: https://github.com/sebastinas/cwcwidth/blob/2bc4360474b524148ffde3c8b837cbb0a4f172f5/.github/workflows/build.yaml#L33 this has the effect of skipping some otherwise-failing tests on darwin. seems slightly counterproductive but who am i to judge? --- pkgs/development/python-modules/cwcwidth/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/cwcwidth/default.nix b/pkgs/development/python-modules/cwcwidth/default.nix index 940d41129e57..ede96fc3b41d 100644 --- a/pkgs/development/python-modules/cwcwidth/default.nix +++ b/pkgs/development/python-modules/cwcwidth/default.nix @@ -13,12 +13,17 @@ buildPythonPackage rec { nativeBuildInputs = [ cython ]; checkInputs = [ pytestCheckHook ]; - # Hack needed to make pytest + cython work - # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298 preCheck = '' + # Hack needed to make pytest + cython work + # https://github.com/NixOS/nixpkgs/pull/82410#issuecomment-827186298 export HOME=$(mktemp -d) cp -r $TMP/$sourceRoot/tests $HOME pushd $HOME + + # locale settings used by upstream, has the effect of skipping + # otherwise-failing tests on darwin + export LC_ALL='C.UTF-8' + export LANG='C.UTF-8' ''; postCheck = "popd";