nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 rustPlatform,
6 numpy,
7 pytestCheckHook,
8 syrupy,
9}:
10
11buildPythonPackage rec {
12 pname = "quil";
13 version = "0.34.0";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "rigetti";
18 repo = "quil-rs";
19 tag = "quil-rs/v${version}";
20 hash = "sha256-to6eKStXiJPqP22kN+gNiroiBUFiK7Q84BuTZHMr5SI=";
21 };
22
23 cargoDeps = rustPlatform.fetchCargoVendor {
24 inherit pname version src;
25 hash = "sha256-vNa4RUIecCHDb9rvMdiC8jtBdM/6C2bKagX1YkSMuhk=";
26 };
27
28 buildAndTestSubdir = "quil-rs";
29
30 nativeBuildInputs = [
31 rustPlatform.cargoSetupHook
32 rustPlatform.maturinBuildHook
33 ];
34
35 dependencies = [ numpy ];
36
37 pythonImportsCheck = [
38 "quil.expression"
39 "quil.instructions"
40 "quil.program"
41 "quil.validation"
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 syrupy
47 ];
48
49 pytestFlags = [
50 "quil-rs/tests_py"
51 ];
52
53 meta = {
54 changelog = "https://github.com/rigetti/quil-rs/blob/${src.tag}/quil-rs/CHANGELOG.md";
55 description = "Python package for building and parsing Quil programs";
56 homepage = "https://github.com/rigetti/quil-rs/tree/main/quil-py";
57 license = lib.licenses.asl20;
58 maintainers = with lib.maintainers; [ dotlambda ];
59 };
60}