aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx/default.nix62
1 files changed, 62 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx/default.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx/default.nix
new file mode 100644
index 000000000000..02a3ef64c573
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/retworkx/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, rustPlatform
+, python
+, fetchFromGitHub
+, pipInstallHook
+, maturin
+, pip
+ # Check inputs
+, pytestCheckHook
+, numpy
+}:
+
+rustPlatform.buildRustPackage rec {
+ pname = "retworkx";
+ version = "0.6.0";
+
+ src = fetchFromGitHub {
+ owner = "Qiskit";
+ repo = "retworkx";
+ rev = version;
+ sha256 = "11n30ldg3y3y6qxg3hbj837pnbwjkqw3nxq6frds647mmmprrd20";
+ };
+
+ cargoSha256 = "1vg4yf0k6yypqf9z46zz818mz7fdrgxj7zl6zjf7pnm2r8mq3qw5";
+
+ propagatedBuildInputs = [ python ];
+
+ nativeBuildInputs = [ pipInstallHook maturin pip ];
+
+ # Needed b/c need to check AFTER python wheel is installed (using Rust Build, not buildPythonPackage)
+ doCheck = false;
+ doInstallCheck = true;
+
+ installCheckInputs = [ pytestCheckHook numpy ];
+
+ buildPhase = ''
+ runHook preBuild
+ maturin build --release --manylinux off --strip
+ runHook postBuild
+ '';
+
+ installPhase = ''
+ install -Dm644 -t dist target/wheels/*.whl
+ pipInstallPhase
+ '';
+
+ preCheck = ''
+ export TESTDIR=$(mktemp -d)
+ cp -r tests/ $TESTDIR
+ pushd $TESTDIR
+ '';
+ postCheck = "popd";
+
+ meta = with lib; {
+ description = "A python graph library implemented in Rust.";
+ homepage = "https://retworkx.readthedocs.io/en/latest/index.html";
+ downloadPage = "https://github.com/Qiskit/retworkx/releases";
+ changelog = "https://github.com/Qiskit/retworkx/releases/tag/${version}";
+ license = licenses.asl20;
+ maintainers = with maintainers; [ drewrisinger ];
+ };
+}