linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / retworkx / default.nix
blobc4b7a6323e4dda4c9af34e7cab33b4374fd01b30
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , rustPlatform
5 , fetchFromGitHub
7   # Check inputs
8 , pytestCheckHook
9 , networkx
10 , numpy
13 buildPythonPackage rec {
14   pname = "retworkx";
15   version = "0.8.0";
16   format = "pyproject";
17   disabled = pythonOlder "3.6";
19   src = fetchFromGitHub {
20     owner = "Qiskit";
21     repo = "retworkx";
22     rev = version;
23     sha256 = "0plpri6a3d6f1000kmcah9066vq2i37d14bdf8sm96493fhpqhrd";
24   };
26   cargoDeps = rustPlatform.fetchCargoTarball {
27     inherit src;
28     name = "${pname}-${version}";
29     hash = "sha256-+k779gmge8wDdoZrWn9ND47kUqt7pqe75Zuj2Byfefo=";
30   };
32   nativeBuildInputs = with rustPlatform; [ cargoSetupHook maturinBuildHook ];
34   # Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
35   doCheck = false;
36   doInstallCheck = true;
38   installCheckInputs = [ pytestCheckHook networkx numpy ];
40   preCheck = ''
41     export TESTDIR=$(mktemp -d)
42     cp -r tests/ $TESTDIR
43     pushd $TESTDIR
44   '';
45   postCheck = "popd";
47   meta = with lib; {
48     description = "A python graph library implemented in Rust.";
49     homepage = "https://retworkx.readthedocs.io/en/latest/index.html";
50     downloadPage = "https://github.com/Qiskit/retworkx/releases";
51     changelog = "https://github.com/Qiskit/retworkx/releases/tag/${version}";
52     license = licenses.asl20;
53     maintainers = with maintainers; [ drewrisinger ];
54   };