lol

python3.pkgs.pyerfa: Enable and fix tests & more

Use NIX_CFLAGS_COMPILE = "-O2", due to upstream issue. cd "$out" to
avoid circular import issue (discuessed downstream at at
https://github.com/NixOS/nixpkgs/issues/255262).

+30 -3
+30 -3
pkgs/development/python-modules/pyerfa/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 + , fetchpatch 4 5 , jinja2 5 6 , oldest-supported-numpy 6 7 , setuptools-scm ··· 8 9 , liberfa 9 10 , packaging 10 11 , numpy 12 + , pytestCheckHook 13 + , pytest-doctestplus 11 14 }: 12 15 13 16 buildPythonPackage rec { 14 17 pname = "pyerfa"; 15 18 format = "pyproject"; 16 19 version = "2.0.0.3"; 17 - 18 - doCheck = false; 19 20 20 21 src = fetchPypi { 21 22 inherit pname version; 22 23 hash = "sha256-13+7+lg1DBlMy5nl2TqgXTwrFNWq2LZi2Txq2f/0Hzk="; 23 24 }; 24 25 26 + patches = [ 27 + # Sort of helps maybe for https://github.com/liberfa/pyerfa/issues/112 28 + (fetchpatch { 29 + url = "https://github.com/liberfa/pyerfa/commit/4866342b94c5e7344711146f1186a4c3e7534da8.patch"; 30 + hash = "sha256-uPFFdLYfRweQdeEApBAw6Ulqh31NTQwwmnaU+x/M+C0="; 31 + }) 32 + ]; 33 + 25 34 nativeBuildInputs = [ 26 35 jinja2 27 36 oldest-supported-numpy ··· 31 40 ]; 32 41 33 42 propagatedBuildInputs = [ 34 - liberfa 35 43 numpy 44 + ]; 45 + buildInputs = [ 46 + liberfa 36 47 ]; 37 48 38 49 preBuild = '' 39 50 export PYERFA_USE_SYSTEM_LIBERFA=1 40 51 ''; 52 + 53 + # See https://github.com/liberfa/pyerfa/issues/112#issuecomment-1721197483 54 + NIX_CFLAGS_COMPILE = "-O2"; 55 + nativeCheckInputs = [ 56 + pytestCheckHook 57 + pytest-doctestplus 58 + ]; 59 + # Getting circular import errors without this, not clear yet why. This was mentioned to 60 + # upstream at: https://github.com/liberfa/pyerfa/issues/112 and downstream at 61 + # https://github.com/NixOS/nixpkgs/issues/255262 62 + preCheck = '' 63 + cd $out 64 + ''; 65 + pythonImportsCheck = [ 66 + "erfa" 67 + ]; 41 68 42 69 meta = with lib; { 43 70 description = "Python bindings for ERFA routines";