From 1bb54f39c2a1730a47e4355891f443e74d46f6be Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Mon, 19 Aug 2024 12:46:25 -0400 Subject: [PATCH] python312Packages.pyzx: init at 0.8.0 --- .../python-modules/pyzx/default.nix | 67 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/pyzx/default.nix diff --git a/pkgs/development/python-modules/pyzx/default.nix b/pkgs/development/python-modules/pyzx/default.nix new file mode 100644 index 000000000000..a391f26a3139 --- /dev/null +++ b/pkgs/development/python-modules/pyzx/default.nix @@ -0,0 +1,67 @@ +{ + lib, + buildPythonPackage, + pythonOlder, + fetchFromGitHub, + pythonRelaxDepsHook, + pytestCheckHook, + setuptools, + ipywidgets, + lark, + numpy, + pyperclip, + tqdm, + typing-extensions, +}: + +buildPythonPackage rec { + pname = "pyzx"; + version = "0.8.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "zxcalc"; + repo = "pyzx"; + rev = "refs/tags/v${version}"; + hash = "sha256-4yc4P2v2L/F/A1A9z41ow2KA0aUA+3SJyC+wyMWzhwM="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + ipywidgets + lark + numpy + pyperclip + tqdm + typing-extensions + ]; + + pythonRelaxDeps = [ "ipywidgets" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + disabledTestPaths = [ + # too expensive, and print results instead of reporting failures: + "tests/long_scalar_test.py" + "tests/long_test.py" + ]; + + pythonImportsCheck = [ + "pyzx" + "pyzx.circuit" + "pyzx.graph" + "pyzx.routing" + "pyzx.local_search" + "pyzx.scripts" + ]; + + meta = { + description = "Library for quantum circuit rewriting and optimisation using the ZX-calculus"; + homepage = "https://github.com/zxcalc/pyzx"; + changelog = "https://github.com/zxcalc/pyzx/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5134f53d3b4c..1c9e91ccedf5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13312,6 +13312,8 @@ self: super: with self; { pyzmq = callPackage ../development/python-modules/pyzmq { }; + pyzx = callPackage ../development/python-modules/pyzx { }; + qbittorrent-api = callPackage ../development/python-modules/qbittorrent-api { }; qasync = callPackage ../development/python-modules/qasync { };