Skip to content

Commit

Permalink
Merge pull request #335857 from bcdarwin/init-python3-pyzx
Browse files Browse the repository at this point in the history
python312Packages.pyzx: init at 0.8.0
  • Loading branch information
dotlambda authored Aug 20, 2024
2 parents 3b20755 + 1bb54f3 commit f02fa2f
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
67 changes: 67 additions & 0 deletions pkgs/development/python-modules/pyzx/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13320,6 +13320,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 { };
Expand Down

0 comments on commit f02fa2f

Please sign in to comment.