summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2021-11-22 23:24:50 +0000
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-11-22 23:05:47 -0800
commit712b402565e53a0e00113e9b617d4edd428d158c (patch)
treee8272b02a0527fd76ff58e7a9dc6dd898e9ee301
parent67c9d4ae0086730668661af469886dfc99f1392e (diff)
downloadnixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar.gz
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar.bz2
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar.lz
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar.xz
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.tar.zst
nixpkgs-712b402565e53a0e00113e9b617d4edd428d158c.zip
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?
-rw-r--r--pkgs/development/python-modules/cwcwidth/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/cwcwidth/default.nix b/pkgs/development/python-modules/cwcwidth/default.nix
index 940d41129e5..ede96fc3b41 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";