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-09-26 11:04:55 +00:00
|
|
|
version = "0.12.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-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-OCQp8WKOxyZNMu2waeasSZ4E8VhFqDZcgGbDoMpKeHg=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
inherit src;
|
2024-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-EmSDjheLEyFr0w6XOvJYdRmGGlv2L/wh3qAN8Nn5lyg=";
|
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-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [ numpy ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"quil.expression"
|
|
|
|
"quil.instructions"
|
|
|
|
"quil.program"
|
|
|
|
"quil.validation"
|
|
|
|
];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|