2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv,
|
2024-04-21 15:54:59 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
syrupy,
|
2024-06-05 15:53:02 +00:00
|
|
|
libiconv,
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "quil";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.10.0";
|
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-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-GJ39pvIqYs2bMGAHJL8OgB0OfmIpo/k3FxorYvdOvhI=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-VvnjdCFrpo/rDLNJrHpZoV+E+fQGgNW/nBOvMG91sHQ=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildAndTestSubdir = "quil-py";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2024-02-29 20:09:43 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustPlatform.maturinBuildHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|