biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / symengine / default.nix
blob16893b3f6e64af17490606d82427656a5b8be9d1
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch,
6   cython,
7   cmake,
8   symengine,
9   pytest,
10   sympy,
11   python,
12   setuptools,
15 buildPythonPackage rec {
16   pname = "symengine";
17   version = "0.11.0";
19   build-system = [ setuptools ];
20   pyproject = true;
22   src = fetchFromGitHub {
23     owner = "symengine";
24     repo = "symengine.py";
25     rev = "refs/tags/v${version}";
26     hash = "sha256-uUMcNnynE2itIwc7IGFwxveqLRL8f4dAAcaD6FUWJaY=";
27   };
29   env = {
30     SymEngine_DIR = "${symengine}";
31   };
33   patches = [
34     # Distutils has been removed in python 3.12
35     # See https://github.com/symengine/symengine.py/pull/478
36     (fetchpatch {
37       name = "no-distutils.patch";
38       url = "https://github.com/symengine/symengine.py/pull/478/commits/e72006d5f7425cd50c54b22766e0ed4bcd2dca85.patch";
39       hash = "sha256-kGJRGkBgxOfI1wf88JwnSztkOYd1wvg62H7wA6CcYEQ=";
40     })
41   ];
43   postPatch = ''
44     substituteInPlace setup.py \
45       --replace-fail "'cython>=0.29.24'" "'cython'"
47     export PATH=${cython}/bin:$PATH
48   '';
50   dontUseCmakeConfigure = true;
51   nativeBuildInputs = [ cmake ];
53   buildInputs = [ cython ];
55   nativeCheckInputs = [
56     pytest
57     sympy
58   ];
60   checkPhase = ''
61     runHook preCheck
62     mkdir empty && cd empty
63     ${python.interpreter} ../bin/test_python.py
64     runHook postCheck
65   '';
67   meta = with lib; {
68     description = "Python library providing wrappers to SymEngine";
69     homepage = "https://github.com/symengine/symengine.py";
70     license = licenses.mit;
71     maintainers = [ ];
72   };