15 excludedTests = [ "reimport_from_subinterpreter" ]
16 # cython's testsuite is not working very well with libc++
17 # We are however optimistic about things outside of testsuite still working
18 ++ lib.optionals (stdenv.cc.isClang or false) [ "cpdef_extern_func" "libcpp_algo" ]
19 # Some tests in the test suite isn't working on aarch64. Disable them for
20 # now until upstream finds a workaround.
21 # Upstream issue here: https://github.com/cython/cython/issues/2308
22 ++ lib.optionals stdenv.isAarch64 [ "numpy_memoryview" ]
23 ++ lib.optionals stdenv.isi686 [ "future_division" "overflow_check_longlong" ]
26 in buildPythonPackage rec {
34 hash = "sha256-QcDP0tdU44PJ7rle/8mqSrhH0Ml0cHfd18Dctow7wB8=";
46 LC_ALL = "en_US.UTF-8";
49 # backport Cython 3.0 trashcan support (https://github.com/cython/cython/pull/2842) to 0.X series.
50 # it does not affect Python code unless the code explicitly uses the feature.
51 # trashcan support is needed to avoid stack overflows during object deallocation in sage (https://trac.sagemath.org/ticket/27267)
53 # The above commit introduces custom trashcan macros, as well as
54 # compiler changes to use them in Cython-emitted code. The latter
55 # change is still useful, but the former has been upstreamed as of
56 # Python 3.8, and the patch below makes Cython use the upstream
57 # trashcan macros whenever available. This is needed for Python
58 # 3.11 support, because the API used in Cython's implementation
59 # changed: https://github.com/cython/cython/pull/4475
61 name = "disable-trashcan.patch";
62 url = "https://github.com/cython/cython/commit/e337825cdcf5e94d38ba06a0cb0188e99ce0cc92.patch";
63 hash = "sha256-q0f63eetKrDpmP5Z4v8EuGxg26heSyp/62OYqhRoSso=";
68 export HOME="$NIX_BUILD_TOP"
69 ${python.interpreter} runtests.py -j$NIX_BUILD_CORES \
71 ${lib.optionalString (builtins.length excludedTests != 0)
72 ''--exclude="(${builtins.concatStringsSep "|" excludedTests})"''}
75 # https://github.com/cython/cython/issues/2785
78 # doCheck = !stdenv.isDarwin;
80 # force regeneration of generated code in source distributions
81 # https://github.com/cython/cython/issues/5089
82 setupHook = ./setup-hook.sh;
85 changelog = "https://github.com/cython/cython/blob/${version}/CHANGES.rst";
86 description = "An optimising static compiler for both the Python programming language and the extended Cython programming language";
87 homepage = "https://cython.org";
88 license = lib.licenses.asl20;
89 maintainers = with lib.maintainers; [ fridh ];