2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
syrupy,
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "quil";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.7.1";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rigetti";
|
|
|
|
repo = "quil-rs";
|
|
|
|
rev = "quil-py/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-GFePbCJnVbzL4cpQ7fy1tk2l7NhAyTVW63lVYTv0/Oo=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-catUGCFbkvov1z52f6eyxogflu61VcjIItgEVEWzkpY=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildAndTestSubdir = "quil-py";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cargo metadata --offline
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2024-02-29 20:09:43 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [ numpy ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "numpy" ];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
syrupy
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Syrupy snapshot needs to be regenerated
|
|
|
|
"test_filter_instructions"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/rigetti/quil-rs/blob/${src.rev}/quil-py/CHANGELOG.md";
|
|
|
|
description = "Python package for building and parsing Quil programs";
|
|
|
|
homepage = "https://github.com/rigetti/quil-rs/tree/main/quil-py";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|