nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 setuptools,
7 ipywidgets,
8 lark,
9 numpy,
10 pyperclip,
11 tqdm,
12 typing-extensions,
13}:
14
15buildPythonPackage rec {
16 pname = "pyzx";
17 version = "0.9.0";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "zxcalc";
22 repo = "pyzx";
23 tag = "v${version}";
24 hash = "sha256-MhsbJIDeSIeF0LaHhI6nNxPD3ZjBWh5yvLGuwBH41a4=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 ipywidgets
31 lark
32 numpy
33 pyperclip
34 tqdm
35 typing-extensions
36 ];
37
38 pythonRelaxDeps = [
39 "ipywidgets"
40 "lark"
41 ];
42
43 nativeCheckInputs = [ pytestCheckHook ];
44 disabledTestPaths = [
45 # too expensive, and print results instead of reporting failures:
46 "tests/long_scalar_test.py"
47 "tests/long_test.py"
48 ];
49
50 pythonImportsCheck = [
51 "pyzx"
52 "pyzx.circuit"
53 "pyzx.graph"
54 "pyzx.routing"
55 "pyzx.local_search"
56 "pyzx.scripts"
57 ];
58
59 meta = {
60 description = "Library for quantum circuit rewriting and optimisation using the ZX-calculus";
61 homepage = "https://github.com/zxcalc/pyzx";
62 changelog = "https://github.com/zxcalc/pyzx/blob/${src.tag}/CHANGELOG.md";
63 license = lib.licenses.asl20;
64 maintainers = with lib.maintainers; [ bcdarwin ];
65 };
66}